[#111,backend/elasticsearch][s]: geo distance filter now working - hurrah!.

This commit is contained in:
Rufus Pollock
2012-06-16 16:31:45 +01:00
parent d17775e39d
commit 8ff885759f
2 changed files with 28 additions and 3 deletions

View File

@@ -49,6 +49,31 @@ test("queryNormalize", function() {
}
};
deepEqual(out, exp);
var in_ = new recline.Model.Query();
in_.addFilter({
type: 'geo_distance',
field: 'xyz'
});
var out = backend._normalizeQuery(in_);
var exp = {
constant_score: {
query: {
match_all: {}
},
filter: {
and: [
{
geo_distance: {
distance: '10km',
'xyz': { lon: 0, lat: 0 }
}
}
]
}
}
};
deepEqual(out, exp);
});
var mapping_data = {