SO i've tried to find an answer to this and i've had no luck in finding the answer. I want to store an IP range such as '184.108.40.206', '220.127.116.11' and then be able to search for data associated within the particular range. so lets say that if i search for 18.104.22.168 the document associated with that range will show up.
I can find a ton of stuff looking up a range but nothing about storing a range
Well, you could create a range query with the IPs and register it in the .percolator on your index, then match the document with the single IP address against the registered queries.
There are some ongoing developments in Lucene about adding the ability to index ranges, which will probably get exposed in elasticsearch at some point: https://issues.apache.org/jira/browse/LUCENE-7381
i didn't know anything about .percolator so i shall read up and see if that helps, thank you for your reply - very helpful
Hi! Why don't create two fields IP_START and IP_END to store start and end of range?
In search query you can compare your IP with it (documentation say that IP stores as long internally so it easyly comparable like numbers).
Like: IP >= IP_START and IP<= IP_END
thanks for you suggestion i'll have a look into it, not sure though that's quite what i'm looking for though