|
|
@ -13,7 +13,7 @@ module.exports.tests.interface = function(test, common) { |
|
|
|
module.exports.tests.query = function(test, common) { |
|
|
|
module.exports.tests.query = function(test, common) { |
|
|
|
test('valid search + focus + bbox', function(t) { |
|
|
|
test('valid search + focus + bbox', function(t) { |
|
|
|
var query = generate({ |
|
|
|
var query = generate({ |
|
|
|
text: 'test', size: 10, |
|
|
|
text: 'test', querySize: 10, |
|
|
|
'focus.point.lat': 29.49136, 'focus.point.lon': -82.50622, |
|
|
|
'focus.point.lat': 29.49136, 'focus.point.lon': -82.50622, |
|
|
|
'boundary.rect.min_lat': 47.47, |
|
|
|
'boundary.rect.min_lat': 47.47, |
|
|
|
'boundary.rect.max_lon': -61.84, |
|
|
|
'boundary.rect.max_lon': -61.84, |
|
|
@ -31,7 +31,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
test('valid search + bbox', function(t) { |
|
|
|
test('valid search + bbox', function(t) { |
|
|
|
var query = generate({ |
|
|
|
var query = generate({ |
|
|
|
text: 'test', size: 10, |
|
|
|
text: 'test', querySize: 10, |
|
|
|
'boundary.rect.min_lat': 47.47, |
|
|
|
'boundary.rect.min_lat': 47.47, |
|
|
|
'boundary.rect.max_lon': -61.84, |
|
|
|
'boundary.rect.max_lon': -61.84, |
|
|
|
'boundary.rect.max_lat': 11.51, |
|
|
|
'boundary.rect.max_lat': 11.51, |
|
|
@ -48,7 +48,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
test('valid lingustic-only search', function(t) { |
|
|
|
test('valid lingustic-only search', function(t) { |
|
|
|
var query = generate({ |
|
|
|
var query = generate({ |
|
|
|
text: 'test', size: 10, |
|
|
|
text: 'test', querySize: 10, |
|
|
|
layers: ['test'] |
|
|
|
layers: ['test'] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -61,7 +61,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
test('search search + focus', function(t) { |
|
|
|
test('search search + focus', function(t) { |
|
|
|
var query = generate({ |
|
|
|
var query = generate({ |
|
|
|
text: 'test', size: 10, |
|
|
|
text: 'test', querySize: 10, |
|
|
|
'focus.point.lat': 29.49136, 'focus.point.lon': -82.50622, |
|
|
|
'focus.point.lat': 29.49136, 'focus.point.lon': -82.50622, |
|
|
|
layers: ['test'] |
|
|
|
layers: ['test'] |
|
|
|
}); |
|
|
|
}); |
|
|
@ -75,7 +75,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
test('search search + viewport', function(t) { |
|
|
|
test('search search + viewport', function(t) { |
|
|
|
var query = generate({ |
|
|
|
var query = generate({ |
|
|
|
text: 'test', size: 10, |
|
|
|
text: 'test', querySize: 10, |
|
|
|
'focus.viewport.min_lat': 28.49136, |
|
|
|
'focus.viewport.min_lat': 28.49136, |
|
|
|
'focus.viewport.max_lat': 30.49136, |
|
|
|
'focus.viewport.max_lat': 30.49136, |
|
|
|
'focus.viewport.min_lon': -87.50622, |
|
|
|
'focus.viewport.min_lon': -87.50622, |
|
|
@ -92,7 +92,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
test('search with viewport diagonal < 1km should set scale to 1km', function(t) { |
|
|
|
test('search with viewport diagonal < 1km should set scale to 1km', function(t) { |
|
|
|
var query = generate({ |
|
|
|
var query = generate({ |
|
|
|
text: 'test', size: 10, |
|
|
|
text: 'test', querySize: 10, |
|
|
|
'focus.viewport.min_lat': 28.49135, |
|
|
|
'focus.viewport.min_lat': 28.49135, |
|
|
|
'focus.viewport.max_lat': 28.49137, |
|
|
|
'focus.viewport.max_lat': 28.49137, |
|
|
|
'focus.viewport.min_lon': -87.50622, |
|
|
|
'focus.viewport.min_lon': -87.50622, |
|
|
@ -109,7 +109,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
test('search search + focus on null island', function(t) { |
|
|
|
test('search search + focus on null island', function(t) { |
|
|
|
var query = generate({ |
|
|
|
var query = generate({ |
|
|
|
text: 'test', size: 10, |
|
|
|
text: 'test', querySize: 10, |
|
|
|
'focus.point.lat': 0, 'focus.point.lon': 0, |
|
|
|
'focus.point.lat': 0, 'focus.point.lon': 0, |
|
|
|
layers: ['test'] |
|
|
|
layers: ['test'] |
|
|
|
}); |
|
|
|
}); |
|
|
@ -126,7 +126,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
var query = generate({ text: address, |
|
|
|
var query = generate({ text: address, |
|
|
|
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', |
|
|
|
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', |
|
|
|
'locality', 'local_admin', 'osmaddress', 'openaddresses' ], |
|
|
|
'locality', 'local_admin', 'osmaddress', 'openaddresses' ], |
|
|
|
size: 10, |
|
|
|
querySize: 10, |
|
|
|
parsed_text: parser.get_parsed_address(address), |
|
|
|
parsed_text: parser.get_parsed_address(address), |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -142,7 +142,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
var query = generate({ text: partial_address, |
|
|
|
var query = generate({ text: partial_address, |
|
|
|
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', |
|
|
|
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', |
|
|
|
'locality', 'local_admin', 'osmaddress', 'openaddresses' ], |
|
|
|
'locality', 'local_admin', 'osmaddress', 'openaddresses' ], |
|
|
|
size: 10, |
|
|
|
querySize: 10, |
|
|
|
parsed_text: parser.get_parsed_address(partial_address), |
|
|
|
parsed_text: parser.get_parsed_address(partial_address), |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -158,7 +158,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
var query = generate({ text: partial_address, |
|
|
|
var query = generate({ text: partial_address, |
|
|
|
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', |
|
|
|
layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', |
|
|
|
'locality', 'local_admin', 'osmaddress', 'openaddresses' ], |
|
|
|
'locality', 'local_admin', 'osmaddress', 'openaddresses' ], |
|
|
|
size: 10, |
|
|
|
querySize: 10, |
|
|
|
parsed_text: parser.get_parsed_address(partial_address), |
|
|
|
parsed_text: parser.get_parsed_address(partial_address), |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -171,7 +171,7 @@ module.exports.tests.query = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
test('valid boundary.country search', function(t) { |
|
|
|
test('valid boundary.country search', function(t) { |
|
|
|
var query = generate({ |
|
|
|
var query = generate({ |
|
|
|
text: 'test', size: 10, |
|
|
|
text: 'test', querySize: 10, |
|
|
|
layers: ['test'], |
|
|
|
layers: ['test'], |
|
|
|
'boundary.country': 'ABC' |
|
|
|
'boundary.country': 'ABC' |
|
|
|
}); |
|
|
|
}); |
|
|
|