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 @@ -297,6 +297,10 @@ class MultiTerms(Bucket):
297297    name  =  "multi_terms" 
298298
299299
300+ class  CategorizeText (Bucket ):
301+     name  =  "categorize_text" 
302+ 
303+ 
300304# metric aggregations 
301305class  TopHits (Agg ):
302306    name  =  "top_hits" 
Original file line number Diff line number Diff line change @@ -312,6 +312,23 @@ def test_multi_terms_aggregation():
312312    } ==  a .to_dict ()
313313
314314
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+ 
315332def  test_median_absolute_deviation_aggregation ():
316333    a  =  aggs .MedianAbsoluteDeviation (field = "rating" )
317334
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments