File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,10 @@ class MultiTerms(Bucket):
300
300
name = "multi_terms"
301
301
302
302
303
+ class CategorizeText (Bucket ):
304
+ name = "categorize_text"
305
+
306
+
303
307
# metric aggregations
304
308
class TopHits (Agg ):
305
309
name = "top_hits"
Original file line number Diff line number Diff line change @@ -312,6 +312,23 @@ def test_multi_terms_aggregation():
312
312
} == a .to_dict ()
313
313
314
314
315
+ def test_categorize_text_aggregation ():
316
+ a = aggs .CategorizeText (
317
+ field = "tags" ,
318
+ categorization_filters = ["\\ w+\\ _\\ d{3}" ],
319
+ max_matched_tokens = 2 ,
320
+ similarity_threshold = 30 ,
321
+ )
322
+ assert {
323
+ "categorize_text" : {
324
+ "field" : "tags" ,
325
+ "categorization_filters" : ["\\ w+\\ _\\ d{3}" ],
326
+ "max_matched_tokens" : 2 ,
327
+ "similarity_threshold" : 30 ,
328
+ }
329
+ } == a .to_dict ()
330
+
331
+
315
332
def test_median_absolute_deviation_aggregation ():
316
333
a = aggs .MedianAbsoluteDeviation (field = "rating" )
317
334
You can’t perform that action at this time.
0 commit comments