Skip to content

Commit 311970e

Browse files
committed
remove postings highlighter as per elastic/elasticsearch#25028
1 parent 2a8b664 commit 311970e

File tree

2 files changed

+0
-59
lines changed

2 files changed

+0
-59
lines changed

src/Nest/Search/Search/Highlighting/HighlighterType.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ public enum HighlighterType
1919
[EnumMember(Value = "plain")]
2020
Plain,
2121

22-
/// <summary>
23-
/// Postings Highlighter.
24-
/// If index_options is set to offsets in the mapping the postings highlighter
25-
/// will be used instead of the plain highlighter
26-
/// </summary>
27-
[EnumMember(Value = "postings")]
28-
Postings,
29-
3022
/// <summary>
3123
/// Fast Vector Highlighter.
3224
/// If term_vector information is provided by setting term_vector to with_positions_offsets
@@ -35,7 +27,6 @@ public enum HighlighterType
3527
[EnumMember(Value = "fvh")]
3628
Fvh,
3729

38-
3930
/// <summary>
4031
/// Unified Highlighter.
4132
/// The unified highlighter can extract offsets from either postings, term vectors, or via re-analyzing text.

src/Tests/Search/Request/HighlightingUsageTests.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,6 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
9494
}
9595
}
9696
}
97-
},
98-
{ "state.offsets", new JObject
99-
{
100-
{ "type", "postings" },
101-
{ "pre_tags", new JArray { "<state>" } },
102-
{ "post_tags", new JArray { "</state>" } },
103-
{ "highlight_query", new JObject
104-
{
105-
{ "terms", new JObject
106-
{
107-
{ "state.offsets", new JArray { "stable" , "bellyup" } }
108-
}
109-
}
110-
}
111-
}
112-
}
11397
}
11498
}
11599
}
@@ -156,20 +140,6 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
156140
.Field(p => p.LeadDeveloper.LastName)
157141
.Query(LastNameSearch)
158142
)
159-
),
160-
fs => fs
161-
.Field(p => p.State.Suffix("offsets"))
162-
.Type(HighlighterType.Postings)
163-
.PreTags("<state>")
164-
.PostTags("</state>")
165-
.HighlightQuery(q => q
166-
.Terms(t => t
167-
.Field(f => f.State.Suffix("offsets"))
168-
.Terms(
169-
StateOfBeing.Stable.ToString().ToLowerInvariant(),
170-
StateOfBeing.BellyUp.ToString().ToLowerInvariant()
171-
)
172-
)
173143
)
174144
)
175145
);
@@ -222,18 +192,6 @@ public HighlightingUsageTests(ReadOnlyCluster cluster, EndpointUsage usage) : ba
222192
Query = LastNameSearch
223193
}
224194
}
225-
},
226-
{ "state.offsets", new HighlightField
227-
{
228-
Type = HighlighterType.Postings,
229-
PreTags = new[] { "<state>"},
230-
PostTags = new[] { "</state>"},
231-
HighlightQuery = new TermsQuery
232-
{
233-
Field = "state.offsets",
234-
Terms = new [] { "stable", "bellyup" }
235-
}
236-
}
237195
}
238196
}
239197
}
@@ -271,14 +229,6 @@ protected override void ExpectResponse(ISearchResponse<Project> response)
271229
highlight.Should().Contain("</name>");
272230
}
273231
}
274-
else if (highlightField.Key == "state.offsets")
275-
{
276-
foreach (var highlight in highlightField.Value.Highlights)
277-
{
278-
highlight.Should().Contain("<state>");
279-
highlight.Should().Contain("</state>");
280-
}
281-
}
282232
else
283233
{
284234
Assert.True(false, $"highlights contains unexpected key {highlightField.Key}");

0 commit comments

Comments
 (0)