Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions query/view/ngrams_last_token_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
};
6 changes: 1 addition & 5 deletions query/view/ngrams_last_token_only_multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
};
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_boundary_country.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_boundary_gid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_linguistic_bbox_san_francisco.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_linguistic_circle_san_francisco.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
],
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_linguistic_focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': [{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_linguistic_focus_null_island.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': [{
Expand Down
44 changes: 20 additions & 24 deletions test/unit/fixture/autocomplete_linguistic_multiple_tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_linguistic_one_char_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_linguistic_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_linguistic_three_char_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_linguistic_two_char_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_with_category_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': [{
Expand Down
18 changes: 7 additions & 11 deletions test/unit/fixture/autocomplete_with_layer_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':[{
Expand Down
Loading