@@ -820,23 +820,23 @@ setup:
820
820
body : { "size" : 0, "aggs" : { "no_field_terms" : { "terms" : { "size": 1 } } } }
821
821
822
822
---
823
- " string profiler via global ordinals " :
823
+ " string profiler via global ordinals filters implementation " :
824
824
- skip :
825
- version : " - 7.8 .99"
826
- reason : debug information added in 7.9 .0
825
+ version : " - 7.99 .99"
826
+ reason : filters implementation first supported with sub-aggregators in 8.0.0, being backported to 7.13 .0
827
827
- do :
828
828
bulk :
829
829
index : test_1
830
830
refresh : true
831
831
body : |
832
832
{ "index": {} }
833
- { "str": "sheep", "number": 1 }
833
+ { "boolean": true, " str": "sheep", "number": 1 }
834
834
{ "index": {} }
835
- { "str": "sheep", "number": 3 }
835
+ { "boolean": true, " str": "sheep", "number": 3 }
836
836
{ "index": {} }
837
- { "str": "cow", "number": 1 }
837
+ { "boolean": true, " str": "cow", "number": 1 }
838
838
{ "index": {} }
839
- { "str": "pig", "number": 1 }
839
+ { "boolean": true, " str": "pig", "number": 1 }
840
840
841
841
- do :
842
842
search :
@@ -860,17 +860,73 @@ setup:
860
860
- match : { aggregations.str_terms.buckets.1.max_number.value: 1 }
861
861
- match : { aggregations.str_terms.buckets.2.key: pig }
862
862
- match : { aggregations.str_terms.buckets.2.max_number.value: 1 }
863
- - match : { profile.shards.0.aggregations.0.type: GlobalOrdinalsStringTermsAggregator }
863
+ - match : { profile.shards.0.aggregations.0.type: StringTermsAggregatorFromFilters }
864
864
- match : { profile.shards.0.aggregations.0.description: str_terms }
865
- - match : { profile.shards.0.aggregations.0.breakdown.collect_count: 4 }
866
- - match : { profile.shards.0.aggregations.0.debug.deferred_aggregators: [ max_number ] }
867
- - match : { profile.shards.0.aggregations.0.debug.collection_strategy: dense }
868
- - match : { profile.shards.0.aggregations.0.debug.result_strategy: terms }
869
- - gt : { profile.shards.0.aggregations.0.debug.segments_with_single_valued_ords: 0 }
870
- - match : { profile.shards.0.aggregations.0.debug.segments_with_multi_valued_ords: 0 }
871
- - match : { profile.shards.0.aggregations.0.debug.has_filter: false }
865
+ - match : { profile.shards.0.aggregations.0.breakdown.collect_count: 0 }
866
+ - match : { profile.shards.0.aggregations.0.debug.delegate: FiltersAggregator.FilterByFilter }
867
+ - match : { profile.shards.0.aggregations.0.debug.delegate_debug.filters.0.query: str:cow }
868
+ - match : { profile.shards.0.aggregations.0.debug.delegate_debug.filters.1.query: str:pig }
869
+ - match : { profile.shards.0.aggregations.0.debug.delegate_debug.filters.2.query: str:sheep }
872
870
- match : { profile.shards.0.aggregations.0.children.0.type: MaxAggregator }
873
871
- match : { profile.shards.0.aggregations.0.children.0.description: max_number }
872
+ - match : { profile.shards.0.aggregations.0.children.0.breakdown.collect_count: 4 }
873
+
874
+ ---
875
+ " string profiler via global ordinals native implementation " :
876
+ - skip :
877
+ version : " - 7.8.99"
878
+ reason : debug information added in 7.9.0
879
+ - do :
880
+ bulk :
881
+ index : test_1
882
+ refresh : true
883
+ body : |
884
+ { "index": {} }
885
+ { "boolean": true, "str": "sheep", "number": 1 }
886
+ { "index": {} }
887
+ { "boolean": true, "str": "sheep", "number": 3 }
888
+ { "index": {} }
889
+ { "boolean": true, "str": "cow", "number": 1 }
890
+ { "index": {} }
891
+ { "boolean": true, "str": "pig", "number": 1 }
892
+
893
+ - do :
894
+ search :
895
+ index : test_1
896
+ body :
897
+ profile : true
898
+ size : 0
899
+ aggs :
900
+ bool : # add a dummy agg "on top" of the child agg just to force it out of filter-by-filter mode
901
+ terms :
902
+ field : boolean
903
+ aggs :
904
+ str_terms :
905
+ terms :
906
+ field : str
907
+ collect_mode : breadth_first
908
+ execution_hint : global_ordinals
909
+ aggs :
910
+ max_number :
911
+ max :
912
+ field : number
913
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.0.key: sheep }
914
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.0.max_number.value: 3 }
915
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.1.key: cow }
916
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.1.max_number.value: 1 }
917
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.2.key: pig }
918
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.2.max_number.value: 1 }
919
+ - match : { profile.shards.0.aggregations.0.children.0.type: GlobalOrdinalsStringTermsAggregator }
920
+ - match : { profile.shards.0.aggregations.0.children.0.description: str_terms }
921
+ - match : { profile.shards.0.aggregations.0.children.0.breakdown.collect_count: 4 }
922
+ - match : { profile.shards.0.aggregations.0.children.0.debug.deferred_aggregators: [ max_number ] }
923
+ - match : { profile.shards.0.aggregations.0.children.0.debug.collection_strategy: remap using many bucket ords }
924
+ - match : { profile.shards.0.aggregations.0.children.0.debug.result_strategy: terms }
925
+ - gt : { profile.shards.0.aggregations.0.children.0.debug.segments_with_single_valued_ords: 0 }
926
+ - match : { profile.shards.0.aggregations.0.children.0.debug.segments_with_multi_valued_ords: 0 }
927
+ - match : { profile.shards.0.aggregations.0.children.0.debug.has_filter: false }
928
+ - match : { profile.shards.0.aggregations.0.children.0.children.0.type: MaxAggregator }
929
+ - match : { profile.shards.0.aggregations.0.children.0.children.0.description: max_number }
874
930
875
931
- do :
876
932
indices.create :
@@ -889,7 +945,7 @@ setup:
889
945
refresh : true
890
946
body : |
891
947
{ "index": {} }
892
- { "str": ["pig", "sheep"], "number": 100 }
948
+ { "boolean": true, " str": ["pig", "sheep"], "number": 100 }
893
949
894
950
- do :
895
951
search :
@@ -898,30 +954,35 @@ setup:
898
954
profile : true
899
955
size : 0
900
956
aggs :
901
- str_terms :
957
+ bool : # add a dummy agg "on top" of the child agg just to force it out of filter-by-filter mode
902
958
terms :
903
- field : str
904
- collect_mode : breadth_first
905
- execution_hint : global_ordinals
959
+ field : boolean
906
960
aggs :
907
- max_number :
908
- max :
909
- field : number
910
- - match : { aggregations.str_terms.buckets.0.key: pig }
911
- - match : { aggregations.str_terms.buckets.0.max_number.value: 100 }
912
- - match : { aggregations.str_terms.buckets.1.key: sheep }
913
- - match : { aggregations.str_terms.buckets.1.max_number.value: 100 }
914
- - match : { profile.shards.0.aggregations.0.type: GlobalOrdinalsStringTermsAggregator }
915
- - match : { profile.shards.0.aggregations.0.description: str_terms }
916
- - match : { profile.shards.0.aggregations.0.breakdown.collect_count: 1 }
917
- - match : { profile.shards.0.aggregations.0.debug.deferred_aggregators: [ max_number ] }
918
- - match : { profile.shards.0.aggregations.0.debug.collection_strategy: dense }
919
- - match : { profile.shards.0.aggregations.0.debug.result_strategy: terms }
920
- - match : { profile.shards.0.aggregations.0.debug.segments_with_single_valued_ords: 0 }
921
- - gt : { profile.shards.0.aggregations.0.debug.segments_with_multi_valued_ords: 0 }
922
- - match : { profile.shards.0.aggregations.0.debug.has_filter: false }
923
- - match : { profile.shards.0.aggregations.0.children.0.type: MaxAggregator }
924
- - match : { profile.shards.0.aggregations.0.children.0.description: max_number }
961
+ str_terms :
962
+ terms :
963
+ field : str
964
+ collect_mode : breadth_first
965
+ execution_hint : global_ordinals
966
+ aggs :
967
+ max_number :
968
+ max :
969
+ field : number
970
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.0.key: pig }
971
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.0.max_number.value: 100 }
972
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.1.key: sheep }
973
+ - match : { aggregations.bool.buckets.0.str_terms.buckets.1.max_number.value: 100 }
974
+ - match : { profile.shards.0.aggregations.0.children.0.type: GlobalOrdinalsStringTermsAggregator }
975
+ - match : { profile.shards.0.aggregations.0.children.0.description: str_terms }
976
+ - match : { profile.shards.0.aggregations.0.children.0.breakdown.collect_count: 1 }
977
+ - match : { profile.shards.0.aggregations.0.children.0.debug.deferred_aggregators: [ max_number ] }
978
+ - match : { profile.shards.0.aggregations.0.children.0.debug.collection_strategy: remap using many bucket ords }
979
+ - match : { profile.shards.0.aggregations.0.children.0.debug.result_strategy: terms }
980
+ - match : { profile.shards.0.aggregations.0.children.0.debug.segments_with_single_valued_ords: 0 }
981
+ - gt : { profile.shards.0.aggregations.0.children.0.debug.segments_with_multi_valued_ords: 0 }
982
+ - match : { profile.shards.0.aggregations.0.children.0.debug.has_filter: false }
983
+ - match : { profile.shards.0.aggregations.0.children.0.children.0.type: MaxAggregator }
984
+ - match : { profile.shards.0.aggregations.0.children.0.children.0.description: max_number }
985
+
925
986
926
987
---
927
988
" string profiler via map " :
0 commit comments