Peter Johnson 9 years ago
parent
commit
cb67dd58d8
  1. 4
      test/unit/fixture/autocomplete_linguistic_final_token.js
  2. 4
      test/unit/fixture/autocomplete_linguistic_focus.js
  3. 4
      test/unit/fixture/autocomplete_linguistic_focus_null_island.js
  4. 4
      test/unit/fixture/autocomplete_linguistic_multiple_tokens.js
  5. 4
      test/unit/fixture/autocomplete_linguistic_only.js
  6. 4
      test/unit/fixture/autocomplete_linguistic_with_admin.js
  7. 4
      test/unit/fixture/autocomplete_single_character_street.js
  8. 12
      test/unit/fixture/autocomplete_with_source_filtering.js
  9. 15
      test/unit/fixture/reverse_null_island.js
  10. 15
      test/unit/fixture/reverse_standard.js
  11. 16
      test/unit/fixture/reverse_with_boundary_country.js
  12. 11
      test/unit/fixture/reverse_with_source_filtering.js
  13. 4
      test/unit/fixture/search_boundary_country.js
  14. 4
      test/unit/fixture/search_full_address.js
  15. 12
      test/unit/fixture/search_linguistic_bbox.js
  16. 4
      test/unit/fixture/search_linguistic_focus.js
  17. 12
      test/unit/fixture/search_linguistic_focus_bbox.js
  18. 4
      test/unit/fixture/search_linguistic_focus_null_island.js
  19. 4
      test/unit/fixture/search_linguistic_only.js
  20. 4
      test/unit/fixture/search_linguistic_viewport.js
  21. 4
      test/unit/fixture/search_partial_address.js
  22. 4
      test/unit/fixture/search_regions_address.js
  23. 12
      test/unit/fixture/search_with_source_filtering.js
  24. 10
      test/unit/query/reverse.js
  25. 4
      test/unit/query/search.js

4
test/unit/fixture/autocomplete_linguistic_final_token.js

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

4
test/unit/fixture/autocomplete_linguistic_focus.js

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

4
test/unit/fixture/autocomplete_linguistic_focus_null_island.js

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

4
test/unit/fixture/autocomplete_linguistic_multiple_tokens.js

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

4
test/unit/fixture/autocomplete_linguistic_only.js

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

4
test/unit/fixture/autocomplete_linguistic_with_admin.js

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

4
test/unit/fixture/autocomplete_single_character_street.js

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

12
test/unit/fixture/autocomplete_with_source_filtering.js

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

15
test/unit/fixture/reverse_null_island.js

@ -2,16 +2,8 @@ var vs = require('../../../query/reverse_defaults');
module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
'must': []
}
},
'filter': {
'bool': {
'must': [
{
'filter': [{
'geo_distance': {
'distance': '500km',
'distance_type': 'plane',
@ -21,10 +13,7 @@ module.exports = {
'lon': 0
}
}
}
]
}
}
}]
}
},
'sort': [

15
test/unit/fixture/reverse_standard.js

@ -2,16 +2,8 @@ var vs = require('../../../query/reverse_defaults');
module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
'must': []
}
},
'filter': {
'bool': {
'must': [
{
'filter': [{
'geo_distance': {
'distance': '500km',
'distance_type': 'plane',
@ -21,10 +13,7 @@ module.exports = {
'lon': -82.50622
}
}
}
]
}
}
}]
}
},
'sort': [

16
test/unit/fixture/reverse_with_boundary_country.js

@ -1,8 +1,6 @@
var vs = require('../../../query/reverse_defaults');
module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
'must': [
@ -14,13 +12,8 @@ module.exports = {
}
}
}
]
}
},
'filter': {
'bool': {
'must': [
{
],
'filter': [{
'geo_distance': {
'distance': '500km',
'distance_type': 'plane',
@ -30,10 +23,7 @@ module.exports = {
'lon': -82.50622
}
}
}
]
}
}
}]
}
},
'sort': [

11
test/unit/fixture/reverse_with_source_filtering.js

@ -2,15 +2,8 @@ var vs = require('../../../query/reverse_defaults');
module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
'must': []
}
},
'filter': {
'bool': {
'must': [
'filter': [
{
'geo_distance': {
'distance': '500km',
@ -29,8 +22,6 @@ module.exports = {
}
]
}
}
}
},
'sort': [
'_score',

4
test/unit/fixture/search_boundary_country.js

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

4
test/unit/fixture/search_full_address.js

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

12
test/unit/fixture/search_linguistic_bbox.js

@ -1,7 +1,5 @@
module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
'must': [{
@ -73,12 +71,8 @@ module.exports = {
'weight': 2
}]
}
}]
}
},
'filter': {
'bool': {
'must': [{
}],
'filter': [{
'geo_bounding_box': {
'center_point': {
'top': 11.51,
@ -90,8 +84,6 @@ module.exports = {
}
}]
}
}
}
},
'sort': [ '_score' ],
'size': 10,

4
test/unit/fixture/search_linguistic_focus.js

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

12
test/unit/fixture/search_linguistic_focus_bbox.js

@ -1,7 +1,5 @@
module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
'must': [{
@ -103,12 +101,8 @@ module.exports = {
'weight': 2
}]
}
}]
}
},
'filter': {
'bool': {
'must': [{
}],
'filter': [{
'geo_bounding_box': {
'center_point': {
'top': 11.51,
@ -120,8 +114,6 @@ module.exports = {
}
}]
}
}
}
},
'sort': [ '_score' ],
'size': 10,

4
test/unit/fixture/search_linguistic_focus_null_island.js

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

4
test/unit/fixture/search_linguistic_only.js

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

4
test/unit/fixture/search_linguistic_viewport.js

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

4
test/unit/fixture/search_partial_address.js

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

4
test/unit/fixture/search_regions_address.js

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

12
test/unit/fixture/search_with_source_filtering.js

@ -1,7 +1,5 @@
module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
'must': [{
@ -73,19 +71,13 @@ module.exports = {
'weight': 2
}]
}
}]
}
},
'filter': {
'bool': {
'must': [{
}],
'filter': [{
'terms': {
'source': ['test_source']
}
}]
}
}
}
},
'sort': [ '_score' ],
'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 expected = require('../fixture/reverse_standard');
t.deepEqual(compiled, expected, 'valid reverse query');
t.deepEqual(compiled, expected, 'reverse_standard');
t.end();
});
@ -38,7 +38,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/reverse_null_island');
t.deepEqual(compiled, expected, 'valid reverse query');
t.deepEqual(compiled, expected, 'reverse_null_island');
t.end();
});
@ -54,7 +54,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
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();
});
@ -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
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();
});

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 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();
});
@ -191,7 +191,7 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
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();
});

Loading…
Cancel
Save