Skip to content

Commit 506eb29

Browse files
committed
added support for tags_schema property on the highlighter fix #343
1 parent 127e544 commit 506eb29

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Nest/DSL/HighlightDescriptor.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public class HighlightDescriptor<T> where T : class
1717
[JsonProperty("fragment_size")]
1818
internal int? _FragmentSize { get; set; }
1919

20+
[JsonProperty("tags_schema")]
21+
internal string _TagsSchema { get; set; }
22+
2023
[JsonProperty("number_of_fragments")]
2124
internal int? _NumberOfFragments { get; set; }
2225

@@ -65,6 +68,12 @@ public HighlightDescriptor<T> OnFields(params Action<HighlightFieldDescriptor<T>
6568
}
6669
return this;
6770
}
71+
72+
public HighlightDescriptor<T> TagsSchema(string schema = "styled")
73+
{
74+
this._TagsSchema = schema;
75+
return this;
76+
}
6877
public HighlightDescriptor<T> PreTags(string preTags)
6978
{
7079
this._PreTags = new[] { preTags };

src/Nest/DSL/HighlightFieldDescriptor.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public class HighlightFieldDescriptor<T> where T : class
3535
[JsonProperty("order")]
3636
internal string _Order { get; set; }
3737

38+
[JsonProperty("tags_schema")]
39+
internal string _TagsSchema { get; set; }
40+
3841
[JsonProperty("require_field_match")]
3942
internal bool? _RequireFieldMatch { get; set; }
4043

@@ -55,6 +58,12 @@ public HighlightFieldDescriptor<T> OnAll()
5558
{
5659
return this.OnField("_all");
5760
}
61+
public HighlightFieldDescriptor<T> TagsSchema(string schema = "styled")
62+
{
63+
this._TagsSchema = schema;
64+
return this;
65+
}
66+
5867
public HighlightFieldDescriptor<T> PreTags(string preTags)
5968
{
6069
this._PreTags = new [] { preTags };

0 commit comments

Comments
 (0)