diff --git a/query/view/ngrams_last_token_only.js b/query/view/ngrams_last_token_only.js index 331418d95..de1a7373d 100644 --- a/query/view/ngrams_last_token_only.js +++ b/query/view/ngrams_last_token_only.js @@ -26,9 +26,5 @@ module.exports = function( vs ){ vsCopy.var('input:name').set( tokens.join(' ') ); // return the view rendered using the copy - return { - 'constant_score': { - '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 dc75cf8e8..dfd3eece9 100644 --- a/query/view/ngrams_last_token_only_multi.js +++ b/query/view/ngrams_last_token_only_multi.js @@ -35,10 +35,6 @@ module.exports = function (adminFields){ if( !rendered ){ return rendered; } // return the view rendered using the copy - return { - 'constant_score': { - 'filter': rendered - } - }; + return rendered; }; }; diff --git a/test/unit/fixture/autocomplete_boundary_country.js b/test/unit/fixture/autocomplete_boundary_country.js index 64a70552c..039689e16 100644 --- a/test/unit/fixture/autocomplete_boundary_country.js +++ b/test/unit/fixture/autocomplete_boundary_country.js @@ -2,17 +2,13 @@ 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 - } - } + '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 5ccb058ca..f67d6c418 100644 --- a/test/unit/fixture/autocomplete_boundary_gid.js +++ b/test/unit/fixture/autocomplete_boundary_gid.js @@ -2,17 +2,13 @@ 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 - } - } + '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 787450f4a..eb6151bcf 100644 --- a/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js +++ b/test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js @@ -2,17 +2,13 @@ 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 - } - } + '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 fdeb8757f..ee566b481 100644 --- a/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js +++ b/test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js @@ -3,17 +3,13 @@ module.exports = { 'bool': { 'must': [ { - 'constant_score': { - '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 bfde87014..d4be10bea 100644 --- a/test/unit/fixture/autocomplete_linguistic_focus.js +++ b/test/unit/fixture/autocomplete_linguistic_focus.js @@ -2,17 +2,13 @@ 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 - } - } + '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 5ceed3548..f8b840cdf 100644 --- a/test/unit/fixture/autocomplete_linguistic_focus_null_island.js +++ b/test/unit/fixture/autocomplete_linguistic_focus_null_island.js @@ -2,17 +2,13 @@ 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 - } - } + '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 157c224d1..ca3c54193 100644 --- a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js +++ b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js @@ -12,30 +12,26 @@ 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' - } - } + '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 3bb89a8fa..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,17 +12,13 @@ module.exports = { } }, { - 'constant_score': { - '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 7a4286910..8aa8ffaeb 100644 --- a/test/unit/fixture/autocomplete_linguistic_one_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_one_char_token.js @@ -2,17 +2,13 @@ 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 - } - } + '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 b8c50a99d..20465b27a 100644 --- a/test/unit/fixture/autocomplete_linguistic_only.js +++ b/test/unit/fixture/autocomplete_linguistic_only.js @@ -2,17 +2,13 @@ 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 - } - } + '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 79b2dea27..aef64204e 100644 --- a/test/unit/fixture/autocomplete_linguistic_three_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_three_char_token.js @@ -2,17 +2,13 @@ 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 - } - } + '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 b95dafacd..26ade2598 100644 --- a/test/unit/fixture/autocomplete_linguistic_two_char_token.js +++ b/test/unit/fixture/autocomplete_linguistic_two_char_token.js @@ -2,17 +2,13 @@ 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 - } - } + '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 5ee33d85a..cf332f957 100644 --- a/test/unit/fixture/autocomplete_with_category_filtering.js +++ b/test/unit/fixture/autocomplete_with_category_filtering.js @@ -2,17 +2,13 @@ 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 - } - } + '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 916e5925a..fceef393f 100644 --- a/test/unit/fixture/autocomplete_with_layer_filtering.js +++ b/test/unit/fixture/autocomplete_with_layer_filtering.js @@ -2,17 +2,13 @@ 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 - } - } + '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 af3eea8c2..de09c6cc9 100644 --- a/test/unit/fixture/autocomplete_with_source_filtering.js +++ b/test/unit/fixture/autocomplete_with_source_filtering.js @@ -2,17 +2,13 @@ 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 - } - } + 'multi_match': { + 'fields': ['name.default', 'name.en'], + 'analyzer': 'peliasQuery', + 'query': 'test', + 'boost': 100, + 'type': 'phrase', + 'slop': 3 } }], 'should':[{