File tree Expand file tree Collapse file tree 4 files changed +27
-1
lines changed
Tests/Nest.Tests.Unit/Search/Highlight Expand file tree Collapse file tree 4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,11 @@ public HighlightFieldDescriptor<T> Type(string type)
138138 Self . Type = type ;
139139 return this ;
140140 }
141+ public HighlightFieldDescriptor < T > Type ( HighlighterType type )
142+ {
143+ Self . Type = type . GetStringValue ( ) ;
144+ return this ;
145+ }
141146 public HighlightFieldDescriptor < T > PreTags ( string preTags )
142147 {
143148 Self . PreTags = new [ ] { preTags } ;
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Runtime . Serialization ;
5+ using System . Text ;
6+
7+ namespace Nest
8+ {
9+ public enum HighlighterType
10+ {
11+ [ EnumMember ( Value = "plain" ) ]
12+ Plain ,
13+ [ EnumMember ( Value = "postings" ) ]
14+ Postings ,
15+ [ EnumMember ( Value = "fvh" ) ]
16+ Fvh
17+ }
18+ }
Original file line number Diff line number Diff line change 369369 <Compile Include =" Enums\FieldDataLoading.cs" />
370370 <Compile Include =" Enums\FieldDataNonStringFormat.cs" />
371371 <Compile Include =" Enums\FieldDataStringFormat.cs" />
372+ <Compile Include =" Enums\HighlighterType.cs" />
372373 <Compile Include =" Enums\NormsLoading.cs" />
373374 <Compile Include =" Enums\RoutingAllocationEnableOption.cs" />
374375 <Compile Include =" Enums\ScriptLang.cs" />
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ public void TestHighlight()
3535 . NoMatchSize ( 200 )
3636 . PreTags ( "<em>" )
3737 . PostTags ( "</em>" )
38+ . Type ( HighlighterType . Plain )
3839 )
3940 ) ;
4041 var json = TestElasticClient . Serialize ( s ) ;
@@ -54,7 +55,8 @@ public void TestHighlight()
5455 _all: {
5556 pre_tags: [""<em>""],
5657 post_tags: [""</em>""],
57- no_match_size: 200
58+ no_match_size: 200,
59+ type: ""plain""
5860 }
5961 },
6062 require_field_match: true,
You can’t perform that action at this time.
0 commit comments