mozilla / elasticutils

[deprecated] A friendly chainable ElasticSearch interface for python
http://elasticutils.rtfd.org
BSD 3-Clause "New" or "Revised" License
243 stars 76 forks source link

Distance filter #255

Closed patrick91 closed 10 years ago

patrick91 commented 10 years ago

I've implemented the geo_distance filter. Let me know if there's any issue.

Example:

get_s().filter(F(location__distance=('5km', 45, 10)))
willkg commented 10 years ago

I had an incredibly minor issue with the footnote. Other than that, this looks good!

Fix that and I'll merge this in. Thank you!

patrick91 commented 10 years ago

Sorry about that. Fixed :)

willkg commented 10 years ago

My bad--I should have thought about this before.

It'd help to have an actual geo distance query test. Having one that makes sure we're building the search the way we hope to is good, but having an actual geo distance query test makes it easier to make sure ElasticUtils continues to work over multiple versions of Elasticsearch where they (sometimes) change syntax for things.

Can you add a test that does an actual geo distance query? After that, this is definitely good to land.

patrick91 commented 10 years ago

Will do that today (hopefully)

willkg commented 10 years ago

I went through and ran the tests against the versions of ES we're supporting and this looks good to me.

Thank you!