Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update analyzers to work with https://github.com/pelias/schema/pull/109 #474

Merged
merged 1 commit into from
Apr 29, 2016
Merged
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: 3 additions & 3 deletions query/autocomplete_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'boundary:rect:type': 'indexed',
'boundary:rect:_cache': true,

'ngram:analyzer': 'peliasPhrase',
'ngram:analyzer': 'peliasQueryPartialToken',
'ngram:field': 'name.default',
'ngram:boost': 100,

'phrase:analyzer': 'peliasPhrase',
'phrase:field': 'phrase.default',
'phrase:analyzer': 'peliasQueryFullToken',
'phrase:field': 'name.default',
'phrase:boost': 1,
'phrase:slop': 2,

Expand Down
2 changes: 1 addition & 1 deletion query/reverse_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'boundary:rect:type': 'indexed',
'boundary:rect:_cache': true,

'ngram:analyzer': 'peliasOneEdgeGram',
'ngram:analyzer': 'peliasQueryPartialToken',
'ngram:field': 'name.default',
'ngram:boost': 1,

Expand Down
2 changes: 1 addition & 1 deletion query/search_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'boundary:rect:type': 'indexed',
'boundary:rect:_cache': true,

'ngram:analyzer': 'peliasOneEdgeGram',
'ngram:analyzer': 'peliasQueryPartialToken',
'ngram:field': 'name.default',
'ngram:boost': 1,

Expand Down
6 changes: 3 additions & 3 deletions test/unit/fixture/autocomplete_linguistic_final_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one',
'type': 'phrase',
Expand All @@ -20,7 +20,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one',
'type': 'phrase',
Expand All @@ -45,7 +45,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one',
'type': 'phrase',
Expand Down
8 changes: 4 additions & 4 deletions test/unit/fixture/autocomplete_linguistic_focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand All @@ -20,7 +20,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand Down Expand Up @@ -64,7 +64,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand All @@ -89,7 +89,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand All @@ -20,7 +20,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand Down Expand Up @@ -64,7 +64,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand All @@ -89,7 +89,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand Down
10 changes: 5 additions & 5 deletions test/unit/fixture/autocomplete_linguistic_multiple_tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module.exports = {
'bool': {
'must': [{
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'name.default': {
'analyzer': 'peliasQueryFullToken',
'type': 'phrase',
'boost': 1,
'slop': 2,
Expand All @@ -18,7 +18,7 @@ module.exports = {
{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'three',
'type': 'phrase',
Expand All @@ -31,7 +31,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one two three',
'type': 'phrase',
Expand All @@ -56,7 +56,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one two three',
'type': 'phrase',
Expand Down
6 changes: 3 additions & 3 deletions test/unit/fixture/autocomplete_linguistic_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand All @@ -20,7 +20,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand All @@ -45,7 +45,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
Expand Down
8 changes: 4 additions & 4 deletions test/unit/fixture/autocomplete_linguistic_with_admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = {
'must': [
{
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'name.default': {
'analyzer': 'peliasQueryFullToken',
'type': 'phrase',
'boost': 1,
'slop': 2,
Expand Down Expand Up @@ -86,7 +86,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one two',
'type': 'phrase',
Expand Down Expand Up @@ -114,7 +114,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one two',
'type': 'phrase',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_boundary_country.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_full_address.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'match': {
'name.default': {
'query': '123 main st',
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_bbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_focus_bbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_focus_null_island.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
{
'match': {
'name.default': {
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1,
'query': 'test'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
{
'match': {
'name.default': {
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1,
'query': 'test'
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_partial_address.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
'match': {
'name.default': {
'query': 'soho grand',
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_regions_address.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
'match': {
'name.default': {
'query': '1 water st',
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1
}
}
Expand Down
18 changes: 9 additions & 9 deletions test/unit/query/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/autocomplete_linguistic_only');

t.deepEqual(compiled, expected, 'valid autocomplete query');
t.deepEqual(compiled, expected, 'autocomplete_linguistic_only');
t.end();
});

Expand All @@ -30,9 +30,9 @@ module.exports.tests.query = function(test, common) {
});

var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/autocomplete_linguistic_multiple_tokens.js');
var expected = require('../fixture/autocomplete_linguistic_multiple_tokens');

t.deepEqual(compiled, expected, 'valid autocomplete query');
t.deepEqual(compiled, expected, 'autocomplete_linguistic_multiple_tokens');
t.end();
});

Expand All @@ -47,9 +47,9 @@ module.exports.tests.query = function(test, common) {
});

var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/autocomplete_linguistic_with_admin.js');
var expected = require('../fixture/autocomplete_linguistic_with_admin');

t.deepEqual(compiled, expected, 'valid autocomplete query');
t.deepEqual(compiled, expected, 'autocomplete_linguistic_with_admin');
t.end();
});

Expand All @@ -62,9 +62,9 @@ module.exports.tests.query = function(test, common) {
});

var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/autocomplete_linguistic_final_token.js');
var expected = require('../fixture/autocomplete_linguistic_final_token');

t.deepEqual(compiled, expected, 'valid autocomplete query');
t.deepEqual(compiled, expected, 'autocomplete_linguistic_final_token');
t.end();
});

Expand All @@ -78,7 +78,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/autocomplete_linguistic_focus');

t.deepEqual(compiled, expected, 'valid autocomplete query');
t.deepEqual(compiled, expected, 'autocomplete_linguistic_focus');
t.end();
});

Expand All @@ -92,7 +92,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/autocomplete_linguistic_focus_null_island');

t.deepEqual(compiled, expected, 'valid autocomplete query');
t.deepEqual(compiled, expected, 'autocomplete_linguistic_focus_null_island');
t.end();
});
};
Expand Down