Browse Source

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

pull/474/head
Peter Johnson 9 years ago
parent
commit
aa3e764e49
  1. 6
      query/autocomplete_defaults.js
  2. 2
      query/reverse_defaults.js
  3. 2
      query/search_defaults.js
  4. 6
      test/unit/fixture/autocomplete_linguistic_final_token.js
  5. 8
      test/unit/fixture/autocomplete_linguistic_focus.js
  6. 8
      test/unit/fixture/autocomplete_linguistic_focus_null_island.js
  7. 10
      test/unit/fixture/autocomplete_linguistic_multiple_tokens.js
  8. 6
      test/unit/fixture/autocomplete_linguistic_only.js
  9. 8
      test/unit/fixture/autocomplete_linguistic_with_admin.js
  10. 2
      test/unit/fixture/search_boundary_country.js
  11. 2
      test/unit/fixture/search_full_address.js
  12. 2
      test/unit/fixture/search_linguistic_bbox.js
  13. 2
      test/unit/fixture/search_linguistic_focus.js
  14. 2
      test/unit/fixture/search_linguistic_focus_bbox.js
  15. 2
      test/unit/fixture/search_linguistic_focus_null_island.js
  16. 2
      test/unit/fixture/search_linguistic_only.js
  17. 2
      test/unit/fixture/search_linguistic_viewport.js
  18. 2
      test/unit/fixture/search_linguistic_viewport_min_diagonal.js
  19. 2
      test/unit/fixture/search_partial_address.js
  20. 2
      test/unit/fixture/search_regions_address.js
  21. 18
      test/unit/query/autocomplete.js

6
query/autocomplete_defaults.js

@ -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,

2
query/reverse_defaults.js

@ -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,

2
query/search_defaults.js

@ -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,

6
test/unit/fixture/autocomplete_linguistic_final_token.js

@ -7,7 +7,7 @@ module.exports = {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one',
'type': 'phrase',
@ -20,7 +20,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one',
'type': 'phrase',
@ -45,7 +45,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one',
'type': 'phrase',

8
test/unit/fixture/autocomplete_linguistic_focus.js

@ -7,7 +7,7 @@ module.exports = {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
@ -20,7 +20,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
@ -64,7 +64,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
@ -89,7 +89,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',

8
test/unit/fixture/autocomplete_linguistic_focus_null_island.js

@ -7,7 +7,7 @@ module.exports = {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
@ -20,7 +20,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
@ -64,7 +64,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
@ -89,7 +89,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',

10
test/unit/fixture/autocomplete_linguistic_multiple_tokens.js

@ -6,8 +6,8 @@ module.exports = {
'bool': {
'must': [{
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'name.default': {
'analyzer': 'peliasQueryFullToken',
'type': 'phrase',
'boost': 1,
'slop': 2,
@ -18,7 +18,7 @@ module.exports = {
{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'three',
'type': 'phrase',
@ -31,7 +31,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one two three',
'type': 'phrase',
@ -56,7 +56,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one two three',
'type': 'phrase',

6
test/unit/fixture/autocomplete_linguistic_only.js

@ -7,7 +7,7 @@ module.exports = {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
@ -20,7 +20,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',
@ -45,7 +45,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'test',
'type': 'phrase',

8
test/unit/fixture/autocomplete_linguistic_with_admin.js

@ -7,8 +7,8 @@ module.exports = {
'must': [
{
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'name.default': {
'analyzer': 'peliasQueryFullToken',
'type': 'phrase',
'boost': 1,
'slop': 2,
@ -86,7 +86,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one two',
'type': 'phrase',
@ -114,7 +114,7 @@ module.exports = {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'one two',
'type': 'phrase',

2
test/unit/fixture/search_boundary_country.js

@ -18,7 +18,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}

2
test/unit/fixture/search_full_address.js

@ -9,7 +9,7 @@ module.exports = {
'match': {
'name.default': {
'query': '123 main st',
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1
}
}

2
test/unit/fixture/search_linguistic_bbox.js

@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],

2
test/unit/fixture/search_linguistic_focus.js

@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],

2
test/unit/fixture/search_linguistic_focus_bbox.js

@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],

2
test/unit/fixture/search_linguistic_focus_null_island.js

@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],

2
test/unit/fixture/search_linguistic_only.js

@ -9,7 +9,7 @@ module.exports = {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'analyzer': 'peliasQueryPartialToken'
}
}
}],

2
test/unit/fixture/search_linguistic_viewport.js

@ -7,7 +7,7 @@ module.exports = {
{
'match': {
'name.default': {
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1,
'query': 'test'
}

2
test/unit/fixture/search_linguistic_viewport_min_diagonal.js

@ -7,7 +7,7 @@ module.exports = {
{
'match': {
'name.default': {
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1,
'query': 'test'
}

2
test/unit/fixture/search_partial_address.js

@ -10,7 +10,7 @@ module.exports = {
'match': {
'name.default': {
'query': 'soho grand',
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1
}
}

2
test/unit/fixture/search_regions_address.js

@ -10,7 +10,7 @@ module.exports = {
'match': {
'name.default': {
'query': '1 water st',
'analyzer': 'peliasOneEdgeGram',
'analyzer': 'peliasQueryPartialToken',
'boost': 1
}
}

18
test/unit/query/autocomplete.js

@ -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();
});
@ -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();
});
@ -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();
});
@ -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();
});
@ -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();
});
@ -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();
});
};

Loading…
Cancel
Save