Skip to content

Commit

Permalink
update analyzers to work with pelias/schema#109
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Mar 29, 2016
1 parent fc71e9b commit aa3e764
Show file tree
Hide file tree
Showing 21 changed files with 48 additions and 48 deletions.
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

0 comments on commit aa3e764

Please sign in to comment.