File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,10 @@ class MultiTerms(Bucket):
309
309
name = "multi_terms"
310
310
311
311
312
+ class CategorizeText (Bucket ):
313
+ name = "categorize_text"
314
+
315
+
312
316
# metric aggregations
313
317
class TopHits (Agg ):
314
318
name = "top_hits"
Original file line number Diff line number Diff line change @@ -342,6 +342,23 @@ def test_multi_terms_aggregation():
342
342
} == a .to_dict ()
343
343
344
344
345
+ def test_categorize_text_aggregation ():
346
+ a = aggs .CategorizeText (
347
+ field = "tags" ,
348
+ categorization_filters = ["\\ w+\\ _\\ d{3}" ],
349
+ max_matched_tokens = 2 ,
350
+ similarity_threshold = 30 ,
351
+ )
352
+ assert {
353
+ "categorize_text" : {
354
+ "field" : "tags" ,
355
+ "categorization_filters" : ["\\ w+\\ _\\ d{3}" ],
356
+ "max_matched_tokens" : 2 ,
357
+ "similarity_threshold" : 30 ,
358
+ }
359
+ } == a .to_dict ()
360
+
361
+
345
362
def test_median_absolute_deviation_aggregation ():
346
363
a = aggs .MedianAbsoluteDeviation (field = "rating" )
347
364
You can’t perform that action at this time.
0 commit comments