|
|
@ -49,21 +49,7 @@ var sort = [ |
|
|
|
} |
|
|
|
} |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
module.exports.tests.query = function(test, common) { |
|
|
|
var expected = { |
|
|
|
test('valid query', function(t) { |
|
|
|
|
|
|
|
var query = generate({ |
|
|
|
|
|
|
|
input: 'test', size: 10, |
|
|
|
|
|
|
|
lat: 29.49136, lon: -82.50622, |
|
|
|
|
|
|
|
bbox: { |
|
|
|
|
|
|
|
top: 47.47,
|
|
|
|
|
|
|
|
right: -61.84,
|
|
|
|
|
|
|
|
bottom: 11.51,
|
|
|
|
|
|
|
|
left: -103.16 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
layers: ['test'] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var expected = { |
|
|
|
|
|
|
|
'query': { |
|
|
|
'query': { |
|
|
|
'filtered': { |
|
|
|
'filtered': { |
|
|
|
'query': { |
|
|
|
'query': { |
|
|
@ -87,7 +73,8 @@ module.exports.tests.query = function(test, common) { |
|
|
|
'bottom':'11.51', |
|
|
|
'bottom':'11.51', |
|
|
|
'left': '-103.16' |
|
|
|
'left': '-103.16' |
|
|
|
}, |
|
|
|
}, |
|
|
|
'_cache': true |
|
|
|
'_cache': true, |
|
|
|
|
|
|
|
'type': 'indexed' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
@ -98,7 +85,21 @@ module.exports.tests.query = function(test, common) { |
|
|
|
'sort': sort, |
|
|
|
'sort': sort, |
|
|
|
'size': 10, |
|
|
|
'size': 10, |
|
|
|
'track_scores': true |
|
|
|
'track_scores': true |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports.tests.query = function(test, common) { |
|
|
|
|
|
|
|
test('valid query', function(t) { |
|
|
|
|
|
|
|
var query = generate({ |
|
|
|
|
|
|
|
input: 'test', size: 10, |
|
|
|
|
|
|
|
lat: 29.49136, lon: -82.50622, |
|
|
|
|
|
|
|
bbox: { |
|
|
|
|
|
|
|
top: 47.47,
|
|
|
|
|
|
|
|
right: -61.84,
|
|
|
|
|
|
|
|
bottom: 11.51,
|
|
|
|
|
|
|
|
left: -103.16 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
layers: ['test'] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
t.deepEqual(query, expected, 'valid search query'); |
|
|
|
t.deepEqual(query, expected, 'valid search query'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
@ -116,43 +117,6 @@ module.exports.tests.query = function(test, common) { |
|
|
|
layers: ['test'] |
|
|
|
layers: ['test'] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var expected = { |
|
|
|
|
|
|
|
'query': { |
|
|
|
|
|
|
|
'filtered': { |
|
|
|
|
|
|
|
'query': { |
|
|
|
|
|
|
|
'bool': { |
|
|
|
|
|
|
|
'must': [{
|
|
|
|
|
|
|
|
'match': { |
|
|
|
|
|
|
|
'name.default': 'test' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'filter': { |
|
|
|
|
|
|
|
'bool': { |
|
|
|
|
|
|
|
'must': [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'geo_bounding_box': { |
|
|
|
|
|
|
|
'center_point': { |
|
|
|
|
|
|
|
'top': '47.47', |
|
|
|
|
|
|
|
'right': '-61.84', |
|
|
|
|
|
|
|
'bottom':'11.51', |
|
|
|
|
|
|
|
'left': '-103.16' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'_cache': true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'sort': sort, |
|
|
|
|
|
|
|
'size': 10, |
|
|
|
|
|
|
|
'track_scores': true |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t.deepEqual(query, expected, 'valid search query'); |
|
|
|
t.deepEqual(query, expected, 'valid search query'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|