ankane/searchkick — pull request #132 by zapnap (2014-02-19 19:20:17+00:00)
Title: support range filter for array fields

Consider a range query represented as a where clause in searchkick like this:

where: { user_ids: { gte: 5, lte: 10 }}

As of right now, this will generate *2* separate filters, one for the gte and one for the lte. This is fine in most circumstances, but if you've got a field that is an array type, it presents some problems.

See http://elasticsearch-users.115913.n3.nabble.com/Numeric-range-quey-or-filter-in-an-array-field-possible-or-not-td4042967.html for an example use case. The example there is pretty illustrative. If you add two separate filters instead of one in that example, the results aren't what you'd expect.