Browse Source

resolve rebase conflict

pull/538/head
missinglink 9 years ago
parent
commit
b4115f2945
  1. 4
      package.json
  2. 2
      query/autocomplete_defaults.js
  3. 2
      query/reverse_defaults.js
  4. 2
      query/search_defaults.js
  5. 4
      test/unit/fixture/autocomplete_linguistic_final_token.js
  6. 4
      test/unit/fixture/autocomplete_linguistic_focus.js
  7. 4
      test/unit/fixture/autocomplete_linguistic_focus_null_island.js
  8. 4
      test/unit/fixture/autocomplete_linguistic_multiple_tokens.js
  9. 4
      test/unit/fixture/autocomplete_linguistic_only.js
  10. 4
      test/unit/fixture/autocomplete_linguistic_with_admin.js
  11. 4
      test/unit/fixture/autocomplete_single_character_street.js
  12. 12
      test/unit/fixture/autocomplete_with_source_filtering.js
  13. 1
      test/unit/fixture/reverse_boundary_circle.js
  14. 16
      test/unit/fixture/reverse_null_island.js
  15. 16
      test/unit/fixture/reverse_standard.js
  16. 17
      test/unit/fixture/reverse_with_boundary_country.js
  17. 12
      test/unit/fixture/reverse_with_source_filtering.js
  18. 4
      test/unit/fixture/search_boundary_country.js
  19. 4
      test/unit/fixture/search_full_address.js
  20. 13
      test/unit/fixture/search_linguistic_bbox.js
  21. 4
      test/unit/fixture/search_linguistic_focus.js
  22. 13
      test/unit/fixture/search_linguistic_focus_bbox.js
  23. 4
      test/unit/fixture/search_linguistic_focus_null_island.js
  24. 4
      test/unit/fixture/search_linguistic_only.js
  25. 4
      test/unit/fixture/search_linguistic_viewport.js
  26. 4
      test/unit/fixture/search_partial_address.js
  27. 4
      test/unit/fixture/search_regions_address.js
  28. 12
      test/unit/fixture/search_with_source_filtering.js
  29. 10
      test/unit/query/reverse.js
  30. 4
      test/unit/query/search.js

4
package.json

@ -49,10 +49,10 @@
"lodash": "^4.5.0", "lodash": "^4.5.0",
"markdown": "0.5.0", "markdown": "0.5.0",
"morgan": "1.7.0", "morgan": "1.7.0",
"pelias-config": "^1.0.1", "pelias-config": "git://github.com/pelias/config.git#elasticsearch2",
"pelias-logger": "^0.0.8", "pelias-logger": "^0.0.8",
"pelias-model": "^4.0.0", "pelias-model": "^4.0.0",
"pelias-query": "7.0.1", "pelias-query": "git://github.com/pelias/query.git#elasticsearch2",
"pelias-suggester-pipeline": "2.0.4", "pelias-suggester-pipeline": "2.0.4",
"pelias-text-analyzer": "^1.0.1", "pelias-text-analyzer": "^1.0.1",
"stats-lite": "1.0.3", "stats-lite": "1.0.3",

2
query/autocomplete_defaults.js

@ -15,10 +15,8 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'boundary:circle:radius': '50km', 'boundary:circle:radius': '50km',
'boundary:circle:distance_type': 'plane', 'boundary:circle:distance_type': 'plane',
'boundary:circle:optimize_bbox': 'indexed', 'boundary:circle:optimize_bbox': 'indexed',
'boundary:circle:_cache': true,
'boundary:rect:type': 'indexed', 'boundary:rect:type': 'indexed',
'boundary:rect:_cache': true,
'ngram:analyzer': 'peliasQueryPartialToken', 'ngram:analyzer': 'peliasQueryPartialToken',
'ngram:field': 'name.default', 'ngram:field': 'name.default',

2
query/reverse_defaults.js

@ -16,10 +16,8 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'boundary:circle:radius:coarse': '500km', 'boundary:circle:radius:coarse': '500km',
'boundary:circle:distance_type': 'plane', 'boundary:circle:distance_type': 'plane',
'boundary:circle:optimize_bbox': 'indexed', 'boundary:circle:optimize_bbox': 'indexed',
'boundary:circle:_cache': true,
'boundary:rect:type': 'indexed', 'boundary:rect:type': 'indexed',
'boundary:rect:_cache': true,
'ngram:analyzer': 'peliasQueryPartialToken', 'ngram:analyzer': 'peliasQueryPartialToken',
'ngram:field': 'name.default', 'ngram:field': 'name.default',

2
query/search_defaults.js

@ -15,10 +15,8 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'boundary:circle:radius': '50km', 'boundary:circle:radius': '50km',
'boundary:circle:distance_type': 'plane', 'boundary:circle:distance_type': 'plane',
'boundary:circle:optimize_bbox': 'indexed', 'boundary:circle:optimize_bbox': 'indexed',
'boundary:circle:_cache': true,
'boundary:rect:type': 'indexed', 'boundary:rect:type': 'indexed',
'boundary:rect:_cache': true,
'ngram:analyzer': 'peliasIndexOneEdgeGram', 'ngram:analyzer': 'peliasIndexOneEdgeGram',
'ngram:field': 'name.default', 'ngram:field': 'name.default',

4
test/unit/fixture/autocomplete_linguistic_final_token.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -71,8 +69,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 20, 'size': 20,

4
test/unit/fixture/autocomplete_linguistic_focus.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -105,8 +103,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 20, 'size': 20,

4
test/unit/fixture/autocomplete_linguistic_focus_null_island.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -105,8 +103,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 20, 'size': 20,

4
test/unit/fixture/autocomplete_linguistic_multiple_tokens.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -84,8 +82,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 20, 'size': 20,

4
test/unit/fixture/autocomplete_linguistic_only.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -61,8 +59,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 20, 'size': 20,

4
test/unit/fixture/autocomplete_linguistic_with_admin.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [ 'must': [
@ -153,8 +151,6 @@ module.exports = {
} }
] ]
} }
}
}
}, },
'size': 20, 'size': 20,
'track_scores': true, 'track_scores': true,

4
test/unit/fixture/autocomplete_single_character_street.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -146,8 +144,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 20, 'size': 20,

12
test/unit/fixture/autocomplete_with_source_filtering.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -59,19 +57,13 @@ module.exports = {
'weight': 3 'weight': 3
}] }]
} }
}] }],
} 'filter': [{
},
'filter': {
'bool': {
'must': [{
'terms': { 'terms': {
'source': ['test_source'] 'source': ['test_source']
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 20, 'size': 20,

1
test/unit/fixture/reverse_boundary_circle.js

@ -14,7 +14,6 @@ module.exports = {
'distance': vs.distance, 'distance': vs.distance,
'distance_type': 'plane', 'distance_type': 'plane',
'optimize_bbox': 'indexed', 'optimize_bbox': 'indexed',
'_cache': true,
'center_point': { 'center_point': {
'lat': 29.49136, 'lat': 29.49136,
'lon': -82.50622 'lon': -82.50622

16
test/unit/fixture/reverse_null_island.js

@ -2,30 +2,18 @@ var vs = require('../../../query/reverse_defaults');
module.exports = { module.exports = {
'query': { 'query': {
'filtered': {
'query': {
'bool': {
'must': []
}
},
'filter': {
'bool': { 'bool': {
'must': [ 'filter': [{
{
'geo_distance': { 'geo_distance': {
'distance': '500km', 'distance': '500km',
'distance_type': 'plane', 'distance_type': 'plane',
'optimize_bbox': 'indexed', 'optimize_bbox': 'indexed',
'_cache': true,
'center_point': { 'center_point': {
'lat': 0, 'lat': 0,
'lon': 0 'lon': 0
} }
} }
} }]
]
}
}
} }
}, },
'sort': [ 'sort': [

16
test/unit/fixture/reverse_standard.js

@ -2,30 +2,18 @@ var vs = require('../../../query/reverse_defaults');
module.exports = { module.exports = {
'query': { 'query': {
'filtered': {
'query': {
'bool': {
'must': []
}
},
'filter': {
'bool': { 'bool': {
'must': [ 'filter': [{
{
'geo_distance': { 'geo_distance': {
'distance': '500km', 'distance': '500km',
'distance_type': 'plane', 'distance_type': 'plane',
'optimize_bbox': 'indexed', 'optimize_bbox': 'indexed',
'_cache': true,
'center_point': { 'center_point': {
'lat': 29.49136, 'lat': 29.49136,
'lon': -82.50622 'lon': -82.50622
} }
} }
} }]
]
}
}
} }
}, },
'sort': [ 'sort': [

17
test/unit/fixture/reverse_with_boundary_country.js

@ -1,8 +1,6 @@
var vs = require('../../../query/reverse_defaults'); var vs = require('../../../query/reverse_defaults');
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [ 'must': [
@ -14,27 +12,18 @@ module.exports = {
} }
} }
} }
] ],
} 'filter': [{
},
'filter': {
'bool': {
'must': [
{
'geo_distance': { 'geo_distance': {
'distance': '500km', 'distance': '500km',
'distance_type': 'plane', 'distance_type': 'plane',
'optimize_bbox': 'indexed', 'optimize_bbox': 'indexed',
'_cache': true,
'center_point': { 'center_point': {
'lat': 29.49136, 'lat': 29.49136,
'lon': -82.50622 'lon': -82.50622
} }
} }
} }]
]
}
}
} }
}, },
'sort': [ 'sort': [

12
test/unit/fixture/reverse_with_source_filtering.js

@ -2,21 +2,13 @@ var vs = require('../../../query/reverse_defaults');
module.exports = { module.exports = {
'query': { 'query': {
'filtered': {
'query': {
'bool': {
'must': []
}
},
'filter': {
'bool': { 'bool': {
'must': [ 'filter': [
{ {
'geo_distance': { 'geo_distance': {
'distance': '500km', 'distance': '500km',
'distance_type': 'plane', 'distance_type': 'plane',
'optimize_bbox': 'indexed', 'optimize_bbox': 'indexed',
'_cache': true,
'center_point': { 'center_point': {
'lat': 29.49136, 'lat': 29.49136,
'lon': -82.50622 'lon': -82.50622
@ -30,8 +22,6 @@ module.exports = {
} }
] ]
} }
}
}
}, },
'sort': [ 'sort': [
'_score', '_score',

4
test/unit/fixture/search_boundary_country.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [ 'must': [
@ -85,8 +83,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 10, 'size': 10,

4
test/unit/fixture/search_full_address.js

@ -1,8 +1,6 @@
var vs = require('../../../query/search_defaults'); var vs = require('../../../query/search_defaults');
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -132,8 +130,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'size': 10, 'size': 10,
'sort': [ '_score' ], 'sort': [ '_score' ],

13
test/unit/fixture/search_linguistic_bbox.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -73,12 +71,8 @@ module.exports = {
'weight': 2 'weight': 2
}] }]
} }
}] }],
} 'filter': [{
},
'filter': {
'bool': {
'must': [{
'geo_bounding_box': { 'geo_bounding_box': {
'center_point': { 'center_point': {
'top': 11.51, 'top': 11.51,
@ -86,13 +80,10 @@ module.exports = {
'bottom': 47.47, 'bottom': 47.47,
'left': -103.16 'left': -103.16
}, },
'_cache': true,
'type': 'indexed' 'type': 'indexed'
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 10, 'size': 10,

4
test/unit/fixture/search_linguistic_focus.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -105,8 +103,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 10, 'size': 10,

13
test/unit/fixture/search_linguistic_focus_bbox.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -103,12 +101,8 @@ module.exports = {
'weight': 2 'weight': 2
}] }]
} }
}] }],
} 'filter': [{
},
'filter': {
'bool': {
'must': [{
'geo_bounding_box': { 'geo_bounding_box': {
'center_point': { 'center_point': {
'top': 11.51, 'top': 11.51,
@ -116,13 +110,10 @@ module.exports = {
'bottom': 47.47, 'bottom': 47.47,
'left': -103.16 'left': -103.16
}, },
'_cache': true,
'type': 'indexed' 'type': 'indexed'
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 10, 'size': 10,

4
test/unit/fixture/search_linguistic_focus_null_island.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -105,8 +103,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 10, 'size': 10,

4
test/unit/fixture/search_linguistic_only.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -75,8 +73,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 10, 'size': 10,

4
test/unit/fixture/search_linguistic_viewport.js

@ -1,6 +1,4 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [ 'must': [
@ -117,8 +115,6 @@ module.exports = {
} }
] ]
} }
}
}
}, },
'size': 10, 'size': 10,
'track_scores': true, 'track_scores': true,

4
test/unit/fixture/search_partial_address.js

@ -2,8 +2,6 @@
var vs = require('../../../query/search_defaults'); var vs = require('../../../query/search_defaults');
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -100,8 +98,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'size': 10, 'size': 10,
'sort': [ '_score' ], 'sort': [ '_score' ],

4
test/unit/fixture/search_regions_address.js

@ -2,8 +2,6 @@
var vs = require('../../../query/search_defaults'); var vs = require('../../../query/search_defaults');
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -116,8 +114,6 @@ module.exports = {
} }
}] }]
} }
}
}
}, },
'size': 10, 'size': 10,
'sort': [ '_score' ], 'sort': [ '_score' ],

12
test/unit/fixture/search_with_source_filtering.js

@ -1,7 +1,5 @@
module.exports = { module.exports = {
'query': {
'filtered': {
'query': { 'query': {
'bool': { 'bool': {
'must': [{ 'must': [{
@ -73,19 +71,13 @@ module.exports = {
'weight': 2 'weight': 2
}] }]
} }
}] }],
} 'filter': [{
},
'filter': {
'bool': {
'must': [{
'terms': { 'terms': {
'source': ['test_source'] 'source': ['test_source']
} }
}] }]
} }
}
}
}, },
'sort': [ '_score' ], 'sort': [ '_score' ],
'size': 20, 'size': 20,

10
test/unit/query/reverse.js

@ -22,7 +22,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) ); var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/reverse_standard'); var expected = require('../fixture/reverse_standard');
t.deepEqual(compiled, expected, 'valid reverse query'); t.deepEqual(compiled, expected, 'reverse_standard');
t.end(); t.end();
}); });
@ -38,7 +38,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) ); var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/reverse_null_island'); var expected = require('../fixture/reverse_null_island');
t.deepEqual(compiled, expected, 'valid reverse query'); t.deepEqual(compiled, expected, 'reverse_null_island');
t.end(); t.end();
}); });
@ -54,7 +54,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) ); var compiled = JSON.parse( JSON.stringify( query ) );
var expected = '123km'; var expected = '123km';
t.deepEqual(compiled.query.filtered.filter.bool.must[0].geo_distance.distance, expected, 'distance set to boundary circle radius'); t.deepEqual(compiled.query.bool.filter[0].geo_distance.distance, expected, 'distance set to boundary circle radius');
t.end(); t.end();
}); });
@ -71,9 +71,9 @@ module.exports.tests.query = function(test, common) {
// this should not equal `point.lat` and `point.lon` as it was explitely specified // this should not equal `point.lat` and `point.lon` as it was explitely specified
var expected = { lat: clean['boundary.circle.lat'], lon: clean['boundary.circle.lon'] }; var expected = { lat: clean['boundary.circle.lat'], lon: clean['boundary.circle.lon'] };
var centroid = compiled.query.filtered.filter.bool.must[0].geo_distance.center_point; var centroid = compiled.query.bool.filter[0].geo_distance.center_point;
t.deepEqual(centroid, expected, 'boundary.circle/lon overrides point.lat/lon'); t.deepEqual(centroid, expected, 'reverse: boundary.circle/lon overrides point.lat/lon');
t.end(); t.end();
}); });

4
test/unit/query/search.js

@ -178,7 +178,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) ); var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_boundary_country'); var expected = require('../fixture/search_boundary_country');
t.deepEqual(compiled, expected, 'valid boundary.country query'); t.deepEqual(compiled, expected, 'search: valid boundary.country query');
t.end(); t.end();
}); });
@ -191,7 +191,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) ); var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_with_source_filtering'); var expected = require('../fixture/search_with_source_filtering');
t.deepEqual(compiled, expected, 'valid search query with source filtering'); t.deepEqual(compiled, expected, 'search: valid search query with source filtering');
t.end(); t.end();
}); });

Loading…
Cancel
Save