@@ -56,6 +56,13 @@ public interface IWordDelimiterGraphTokenFilter : ITokenFilter
56
56
[ JsonFormatter ( typeof ( NullableStringBooleanFormatter ) ) ]
57
57
bool ? GenerateWordParts { get ; set ; }
58
58
59
+ /// <summary>
60
+ /// If true, the filter skips tokens with a keyword attribute of true. Defaults to false.
61
+ /// </summary>
62
+ [ DataMember ( Name = "ignore_keywords" ) ]
63
+ [ JsonFormatter ( typeof ( NullableStringBooleanFormatter ) ) ]
64
+ bool ? IgnoreKeywords { get ; set ; }
65
+
59
66
/// <summary>
60
67
/// If true includes original words in subwords: "500-42" ⇒ "500-42" "500" "42". Defaults to false.
61
68
/// </summary>
@@ -133,6 +140,9 @@ public WordDelimiterGraphTokenFilter() : base("word_delimiter_graph") { }
133
140
/// <inheritdoc />
134
141
public bool ? GenerateWordParts { get ; set ; }
135
142
143
+ /// <inheritdoc />
144
+ public bool ? IgnoreKeywords { get ; set ; }
145
+
136
146
/// <inheritdoc />
137
147
public bool ? PreserveOriginal { get ; set ; }
138
148
@@ -169,8 +179,8 @@ public class WordDelimiterGraphTokenFilterDescriptor
169
179
bool ? IWordDelimiterGraphTokenFilter . CatenateWords { get ; set ; }
170
180
bool ? IWordDelimiterGraphTokenFilter . GenerateNumberParts { get ; set ; }
171
181
bool ? IWordDelimiterGraphTokenFilter . GenerateWordParts { get ; set ; }
182
+ bool ? IWordDelimiterGraphTokenFilter . IgnoreKeywords { get ; set ; }
172
183
bool ? IWordDelimiterGraphTokenFilter . PreserveOriginal { get ; set ; }
173
-
174
184
IEnumerable < string > IWordDelimiterGraphTokenFilter . ProtectedWords { get ; set ; }
175
185
string IWordDelimiterGraphTokenFilter . ProtectedWordsPath { get ; set ; }
176
186
bool ? IWordDelimiterGraphTokenFilter . SplitOnCaseChange { get ; set ; }
@@ -187,6 +197,14 @@ public WordDelimiterGraphTokenFilterDescriptor GenerateWordParts(bool? generateW
187
197
public WordDelimiterGraphTokenFilterDescriptor GenerateNumberParts ( bool ? generateNumberParts = true ) =>
188
198
Assign ( generateNumberParts , ( a , v ) => a . GenerateNumberParts = v ) ;
189
199
200
+ /// <summary>
201
+ /// <para>Configure whether the filter will skip tokens with a keyword attribute of true.</para>
202
+ /// <para>(Optional) When not configured, this defaults to false in Elasticsearch.</para>
203
+ /// </summary>
204
+ /// <param name="ignoreKeywords">If true, the filter skips tokens with a keyword attribute of true.</param>
205
+ public WordDelimiterGraphTokenFilterDescriptor IgnoreKeywords ( bool ? ignoreKeywords = true ) =>
206
+ Assign ( ignoreKeywords , ( a , v ) => a . IgnoreKeywords = v ) ;
207
+
190
208
/// <inheritdoc />
191
209
public WordDelimiterGraphTokenFilterDescriptor CatenateWords ( bool ? catenateWords = true ) => Assign ( catenateWords , ( a , v ) => a . CatenateWords = v ) ;
192
210
0 commit comments