Skip to content

Commit

Permalink
Merge pull request pelias#1376 from pelias/constant_score_filter
Browse files Browse the repository at this point in the history
constant_score subqueries should use "filter" not "query"
  • Loading branch information
missinglink authored Nov 4, 2019
2 parents 8b881da + c34a0b3 commit 4f8c9eb
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion query/view/ngrams_last_token_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function( vs ){
// return the view rendered using the copy
return {
'constant_score': {
'query': ngrams_strict( vsCopy )
'filter': ngrams_strict( vsCopy )
}
};
};
2 changes: 1 addition & 1 deletion query/view/ngrams_last_token_only_multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function (adminFields){
// return the view rendered using the copy
return {
'constant_score': {
'query': rendered
'filter': rendered
}
};
};
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/autocomplete_boundary_country.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/autocomplete_boundary_gid.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'must': [
{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/autocomplete_linguistic_focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
},
{
'constant_score': {
'query': {
'filter': {
'multi_match': {
'fields': [
'parent.country.ngram^1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
},
{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/autocomplete_linguistic_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/autocomplete_with_category_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/autocomplete_with_layer_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/autocomplete_with_source_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
'bool': {
'must': [{
'constant_score': {
'query': {
'filter': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQuery',
Expand Down

0 comments on commit 4f8c9eb

Please sign in to comment.