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 @@ -309,6 +309,10 @@ class MultiTerms(Bucket):
309309    name  =  "multi_terms" 
310310
311311
312+ class  CategorizeText (Bucket ):
313+     name  =  "categorize_text" 
314+ 
315+ 
312316# metric aggregations 
313317class  TopHits (Agg ):
314318    name  =  "top_hits" 
Original file line number Diff line number Diff line change @@ -342,6 +342,23 @@ def test_multi_terms_aggregation():
342342    } ==  a .to_dict ()
343343
344344
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+ 
345362def  test_median_absolute_deviation_aggregation ():
346363    a  =  aggs .MedianAbsoluteDeviation (field = "rating" )
347364
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments