From a4632959b4e1ba9e1e7bd3e85ee88127b856ee71 Mon Sep 17 00:00:00 2001 From: missinglink Date: Fri, 30 Apr 2021 11:22:13 +1200 Subject: [PATCH 1/2] fix(query): remove constant_score clause from autocomplete queries --- query/view/ngrams_last_token_only.js | 4 +- query/view/ngrams_last_token_only_multi.js | 4 +- .../fixture/autocomplete_boundary_country.js | 18 ++++---- .../unit/fixture/autocomplete_boundary_gid.js | 18 ++++---- ...ocomplete_linguistic_bbox_san_francisco.js | 18 ++++---- ...omplete_linguistic_circle_san_francisco.js | 18 ++++---- .../fixture/autocomplete_linguistic_focus.js | 18 ++++---- ...tocomplete_linguistic_focus_null_island.js | 18 ++++---- ...autocomplete_linguistic_multiple_tokens.js | 44 +++++++++---------- ...uistic_multiple_tokens_complete_numeric.js | 18 ++++---- .../autocomplete_linguistic_one_char_token.js | 18 ++++---- .../fixture/autocomplete_linguistic_only.js | 18 ++++---- ...utocomplete_linguistic_three_char_token.js | 18 ++++---- .../autocomplete_linguistic_two_char_token.js | 18 ++++---- .../autocomplete_with_category_filtering.js | 18 ++++---- .../autocomplete_with_layer_filtering.js | 18 ++++---- .../autocomplete_with_source_filtering.js | 18 ++++---- 17 files changed, 135 insertions(+), 169 deletions(-) diff --git a/query/view/ngrams_last_token_only.js b/query/view/ngrams_last_token_only.js index 331418d95..5707f2db3 100644 --- a/query/view/ngrams_last_token_only.js +++ b/query/view/ngrams_last_token_only.js @@ -27,8 +27,6 @@ module.exports = function( vs ){ // return the view rendered using the copy return { - 'constant_score': { - 'filter': ngrams_strict( vsCopy ) - } + 'filter': ngrams_strict( vsCopy ) }; }; diff --git a/query/view/ngrams_last_token_only_multi.js b/query/view/ngrams_last_token_only_multi.js index dc75cf8e8..521867b38 100644 --- a/query/view/ngrams_last_token_only_multi.js +++ b/query/view/ngrams_last_token_only_multi.js @@ -36,9 +36,7 @@ module.exports = function (adminFields){ // return the view rendered using the copy return { - 'constant_score': { - 'filter': rendered - } + 'filter': rendered }; }; }; diff --git a/test/unit/fixture/autocomplete_boundary_country.js b/test/unit/fixture/autocomplete_boundary_country.js index 64a70552c..5fd36f8e8 100644 --- a/test/unit/fixture/autocomplete_boundary_country.js +++ b/test/unit/fixture/autocomplete_boundary_country.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_boundary_gid.js b/test/unit/fixture/autocomplete_boundary_gid.js index 5ccb058ca..6e0c4fdad 100644 --- a/test/unit/fixture/autocomplete_boundary_gid.js +++ b/test/unit/fixture/autocomplete_boundary_gid.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js b/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js index 787450f4a..4c4432a85 100644 --- a/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js +++ b/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js b/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js index fdeb8757f..b750b013a 100644 --- a/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js +++ b/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js @@ -3,16 +3,14 @@ module.exports = { 'bool': { 'must': [ { - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } } diff --git a/test/unit/fixture/autocomplete_linguistic_focus.js b/test/unit/fixture/autocomplete_linguistic_focus.js index bfde87014..950b057d5 100644 --- a/test/unit/fixture/autocomplete_linguistic_focus.js +++ b/test/unit/fixture/autocomplete_linguistic_focus.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_focus_null_island.js b/test/unit/fixture/autocomplete_linguistic_focus_null_island.js index 5ceed3548..25a23555b 100644 --- a/test/unit/fixture/autocomplete_linguistic_focus_null_island.js +++ b/test/unit/fixture/autocomplete_linguistic_focus_null_island.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js index 157c224d1..cfbd58057 100644 --- a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js +++ b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js @@ -12,29 +12,27 @@ module.exports = { } }, { - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': [ - 'parent.country.ngram^1', - 'parent.dependency.ngram^1', - 'parent.macroregion.ngram^1', - 'parent.region.ngram^1', - 'parent.county.ngram^1', - 'parent.localadmin.ngram^1', - 'parent.locality.ngram^1', - 'parent.borough.ngram^1', - 'parent.neighbourhood.ngram^1', - 'parent.locality_a.ngram^1', - 'parent.region_a.ngram^1', - 'parent.country_a.ngram^1', - 'name.default^1.5', - 'name.en^1.5' - ], - 'query': 'three', - 'analyzer': 'peliasQuery', - 'type': 'cross_fields' - } + 'filter': { + 'multi_match': { + 'fields': [ + 'parent.country.ngram^1', + 'parent.dependency.ngram^1', + 'parent.macroregion.ngram^1', + 'parent.region.ngram^1', + 'parent.county.ngram^1', + 'parent.localadmin.ngram^1', + 'parent.locality.ngram^1', + 'parent.borough.ngram^1', + 'parent.neighbourhood.ngram^1', + 'parent.locality_a.ngram^1', + 'parent.region_a.ngram^1', + 'parent.country_a.ngram^1', + 'name.default^1.5', + 'name.en^1.5' + ], + 'query': 'three', + 'analyzer': 'peliasQuery', + 'type': 'cross_fields' } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_multiple_tokens_complete_numeric.js b/test/unit/fixture/autocomplete_linguistic_multiple_tokens_complete_numeric.js index 3bb89a8fa..f91822ba0 100644 --- a/test/unit/fixture/autocomplete_linguistic_multiple_tokens_complete_numeric.js +++ b/test/unit/fixture/autocomplete_linguistic_multiple_tokens_complete_numeric.js @@ -12,16 +12,14 @@ module.exports = { } }, { - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'three', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'three', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_one_char_token.js b/test/unit/fixture/autocomplete_linguistic_one_char_token.js index 7a4286910..15608d566 100644 --- a/test/unit/fixture/autocomplete_linguistic_one_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_one_char_token.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 't', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 't', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_only.js b/test/unit/fixture/autocomplete_linguistic_only.js index b8c50a99d..040a9c9d0 100644 --- a/test/unit/fixture/autocomplete_linguistic_only.js +++ b/test/unit/fixture/autocomplete_linguistic_only.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_three_char_token.js b/test/unit/fixture/autocomplete_linguistic_three_char_token.js index 79b2dea27..2197cbaa8 100644 --- a/test/unit/fixture/autocomplete_linguistic_three_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_three_char_token.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'tes', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'tes', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_linguistic_two_char_token.js b/test/unit/fixture/autocomplete_linguistic_two_char_token.js index b95dafacd..38e5cb0ed 100644 --- a/test/unit/fixture/autocomplete_linguistic_two_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_two_char_token.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'te', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'te', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_with_category_filtering.js b/test/unit/fixture/autocomplete_with_category_filtering.js index 5ee33d85a..37d7c58fd 100644 --- a/test/unit/fixture/autocomplete_with_category_filtering.js +++ b/test/unit/fixture/autocomplete_with_category_filtering.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_with_layer_filtering.js b/test/unit/fixture/autocomplete_with_layer_filtering.js index 916e5925a..1821a55df 100644 --- a/test/unit/fixture/autocomplete_with_layer_filtering.js +++ b/test/unit/fixture/autocomplete_with_layer_filtering.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], diff --git a/test/unit/fixture/autocomplete_with_source_filtering.js b/test/unit/fixture/autocomplete_with_source_filtering.js index af3eea8c2..c88ce5c6a 100644 --- a/test/unit/fixture/autocomplete_with_source_filtering.js +++ b/test/unit/fixture/autocomplete_with_source_filtering.js @@ -2,16 +2,14 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'constant_score': { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'filter': { + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } }], From 440b57fcdf23370a9972569d688ca9a78d37f45d Mon Sep 17 00:00:00 2001 From: missinglink Date: Fri, 30 Apr 2021 11:32:37 +1200 Subject: [PATCH 2/2] fix(query): remove constant_score clause from autocomplete queries --- query/view/ngrams_last_token_only.js | 4 +- query/view/ngrams_last_token_only_multi.js | 4 +- .../fixture/autocomplete_boundary_country.js | 16 ++++--- .../unit/fixture/autocomplete_boundary_gid.js | 16 ++++--- ...ocomplete_linguistic_bbox_san_francisco.js | 16 ++++--- ...omplete_linguistic_circle_san_francisco.js | 16 ++++--- .../fixture/autocomplete_linguistic_focus.js | 16 ++++--- ...tocomplete_linguistic_focus_null_island.js | 16 ++++--- ...autocomplete_linguistic_multiple_tokens.js | 42 +++++++++---------- ...uistic_multiple_tokens_complete_numeric.js | 16 ++++--- .../autocomplete_linguistic_one_char_token.js | 16 ++++--- .../fixture/autocomplete_linguistic_only.js | 16 ++++--- ...utocomplete_linguistic_three_char_token.js | 16 ++++--- .../autocomplete_linguistic_two_char_token.js | 16 ++++--- .../autocomplete_with_category_filtering.js | 16 ++++--- .../autocomplete_with_layer_filtering.js | 16 ++++--- .../autocomplete_with_source_filtering.js | 16 ++++--- 17 files changed, 120 insertions(+), 154 deletions(-) diff --git a/query/view/ngrams_last_token_only.js b/query/view/ngrams_last_token_only.js index 5707f2db3..de1a7373d 100644 --- a/query/view/ngrams_last_token_only.js +++ b/query/view/ngrams_last_token_only.js @@ -26,7 +26,5 @@ module.exports = function( vs ){ vsCopy.var('input:name').set( tokens.join(' ') ); // return the view rendered using the copy - return { - 'filter': ngrams_strict( vsCopy ) - }; + return ngrams_strict( vsCopy ); }; diff --git a/query/view/ngrams_last_token_only_multi.js b/query/view/ngrams_last_token_only_multi.js index 521867b38..dfd3eece9 100644 --- a/query/view/ngrams_last_token_only_multi.js +++ b/query/view/ngrams_last_token_only_multi.js @@ -35,8 +35,6 @@ module.exports = function (adminFields){ if( !rendered ){ return rendered; } // return the view rendered using the copy - return { - 'filter': rendered - }; + return rendered; }; }; diff --git a/test/unit/fixture/autocomplete_boundary_country.js b/test/unit/fixture/autocomplete_boundary_country.js index 5fd36f8e8..039689e16 100644 --- a/test/unit/fixture/autocomplete_boundary_country.js +++ b/test/unit/fixture/autocomplete_boundary_country.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{ diff --git a/test/unit/fixture/autocomplete_boundary_gid.js b/test/unit/fixture/autocomplete_boundary_gid.js index 6e0c4fdad..f67d6c418 100644 --- a/test/unit/fixture/autocomplete_boundary_gid.js +++ b/test/unit/fixture/autocomplete_boundary_gid.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{ diff --git a/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js b/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js index 4c4432a85..eb6151bcf 100644 --- a/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js +++ b/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{ diff --git a/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js b/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js index b750b013a..ee566b481 100644 --- a/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js +++ b/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js @@ -3,15 +3,13 @@ module.exports = { 'bool': { 'must': [ { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } } ], diff --git a/test/unit/fixture/autocomplete_linguistic_focus.js b/test/unit/fixture/autocomplete_linguistic_focus.js index 950b057d5..d4be10bea 100644 --- a/test/unit/fixture/autocomplete_linguistic_focus.js +++ b/test/unit/fixture/autocomplete_linguistic_focus.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should': [{ diff --git a/test/unit/fixture/autocomplete_linguistic_focus_null_island.js b/test/unit/fixture/autocomplete_linguistic_focus_null_island.js index 25a23555b..f8b840cdf 100644 --- a/test/unit/fixture/autocomplete_linguistic_focus_null_island.js +++ b/test/unit/fixture/autocomplete_linguistic_focus_null_island.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should': [{ diff --git a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js index cfbd58057..ca3c54193 100644 --- a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js +++ b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js @@ -12,28 +12,26 @@ module.exports = { } }, { - 'filter': { - 'multi_match': { - 'fields': [ - 'parent.country.ngram^1', - 'parent.dependency.ngram^1', - 'parent.macroregion.ngram^1', - 'parent.region.ngram^1', - 'parent.county.ngram^1', - 'parent.localadmin.ngram^1', - 'parent.locality.ngram^1', - 'parent.borough.ngram^1', - 'parent.neighbourhood.ngram^1', - 'parent.locality_a.ngram^1', - 'parent.region_a.ngram^1', - 'parent.country_a.ngram^1', - 'name.default^1.5', - 'name.en^1.5' - ], - 'query': 'three', - 'analyzer': 'peliasQuery', - 'type': 'cross_fields' - } + 'multi_match': { + 'fields': [ + 'parent.country.ngram^1', + 'parent.dependency.ngram^1', + 'parent.macroregion.ngram^1', + 'parent.region.ngram^1', + 'parent.county.ngram^1', + 'parent.localadmin.ngram^1', + 'parent.locality.ngram^1', + 'parent.borough.ngram^1', + 'parent.neighbourhood.ngram^1', + 'parent.locality_a.ngram^1', + 'parent.region_a.ngram^1', + 'parent.country_a.ngram^1', + 'name.default^1.5', + 'name.en^1.5' + ], + 'query': 'three', + 'analyzer': 'peliasQuery', + 'type': 'cross_fields' } }], 'should':[ diff --git a/test/unit/fixture/autocomplete_linguistic_multiple_tokens_complete_numeric.js b/test/unit/fixture/autocomplete_linguistic_multiple_tokens_complete_numeric.js index f91822ba0..87c027b8e 100644 --- a/test/unit/fixture/autocomplete_linguistic_multiple_tokens_complete_numeric.js +++ b/test/unit/fixture/autocomplete_linguistic_multiple_tokens_complete_numeric.js @@ -12,15 +12,13 @@ module.exports = { } }, { - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'three', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'three', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should': [ diff --git a/test/unit/fixture/autocomplete_linguistic_one_char_token.js b/test/unit/fixture/autocomplete_linguistic_one_char_token.js index 15608d566..8aa8ffaeb 100644 --- a/test/unit/fixture/autocomplete_linguistic_one_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_one_char_token.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 't', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 't', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{ diff --git a/test/unit/fixture/autocomplete_linguistic_only.js b/test/unit/fixture/autocomplete_linguistic_only.js index 040a9c9d0..20465b27a 100644 --- a/test/unit/fixture/autocomplete_linguistic_only.js +++ b/test/unit/fixture/autocomplete_linguistic_only.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{ diff --git a/test/unit/fixture/autocomplete_linguistic_three_char_token.js b/test/unit/fixture/autocomplete_linguistic_three_char_token.js index 2197cbaa8..aef64204e 100644 --- a/test/unit/fixture/autocomplete_linguistic_three_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_three_char_token.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'tes', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'tes', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{ diff --git a/test/unit/fixture/autocomplete_linguistic_two_char_token.js b/test/unit/fixture/autocomplete_linguistic_two_char_token.js index 38e5cb0ed..26ade2598 100644 --- a/test/unit/fixture/autocomplete_linguistic_two_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_two_char_token.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'te', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'te', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{ diff --git a/test/unit/fixture/autocomplete_with_category_filtering.js b/test/unit/fixture/autocomplete_with_category_filtering.js index 37d7c58fd..cf332f957 100644 --- a/test/unit/fixture/autocomplete_with_category_filtering.js +++ b/test/unit/fixture/autocomplete_with_category_filtering.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should': [{ diff --git a/test/unit/fixture/autocomplete_with_layer_filtering.js b/test/unit/fixture/autocomplete_with_layer_filtering.js index 1821a55df..fceef393f 100644 --- a/test/unit/fixture/autocomplete_with_layer_filtering.js +++ b/test/unit/fixture/autocomplete_with_layer_filtering.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{ diff --git a/test/unit/fixture/autocomplete_with_source_filtering.js b/test/unit/fixture/autocomplete_with_source_filtering.js index c88ce5c6a..de09c6cc9 100644 --- a/test/unit/fixture/autocomplete_with_source_filtering.js +++ b/test/unit/fixture/autocomplete_with_source_filtering.js @@ -2,15 +2,13 @@ module.exports = { 'query': { 'bool': { 'must': [{ - 'filter': { - 'multi_match': { - 'fields': ['name.default', 'name.en'], - 'analyzer': 'peliasQuery', - 'query': 'test', - 'boost': 100, - 'type': 'phrase', - 'slop': 3 - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{