aparo / pyes

Python connector for ElasticSearch - the pythonic way to use ElasticSearch
BSD 3-Clause "New" or "Revised" License
607 stars 270 forks source link

Allow both ends of range to be specified in ESRangeOp #373

Closed itsadok closed 10 years ago

itsadok commented 10 years ago

Currently, if you want to use new-style ranges, you have to awkwardly combine two of them, like shown here. This patch allows defining both ends of the range in one operator.

I'm not sure what kind of emphasis this project has on backwards compatibility, but if someone has code calling the ESRangeOp constructor with the boost parameter used by position, this will cause them problems. You can add a line testing whether op2 is a number, and if so assign it to boost or throw an Exception. Or you can reject the PR altogether. I won't be offended.

(Personally I think usage of the boost parameter is too rare to worry about).

aparo commented 10 years ago

No for me it's ok. Thanks for contributing