elasticsearch range filter for array field

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

elasticsearch range filter for array field

manmanluo
This post has NOT been accepted by the mailing list yet.
I have a field containing an array of integers eg:

_source: {
  ...
  prices: [
    20001,
    30001
  ]
}
I'd like to filter the results such that prices contains at least one of a list of values which are between  eg:
[20002,30000] # would not return the above document because no value is between 20002 and 30000
but [10000,20002] would return above document because 20001 in the prices field of above document is between 10000 and 20002