I have an index where documents contain two fields that together make up a range, ie:
"office_postal_from" : [
"1500",
"1800",
"2000"
],
"office_postal_to" : [
"1799",
"1999",
"2000"
]
(See this gist for a complete example)
So in the case above, there are 3 ranges: 1500-1799, 1800-1999, 2000-2000 (disregard the obvious case for improving the range data here).
How can I query ES with the question: "give me all documents in which the postal code 1650 is within a range in the document" - and then receive the above document as one of the results?
I'm not very proficient with ES, but I have looked around quite a bit now, and have been entirely unable to get ideas on how to achieve this.
I'm using ES 5.2 btw.