Support ip_range field formatting (cidr, range) #89698
Labels
>enhancement
:Search/Mapping
Index mappings, including merging and defining field types
Team:Search
Meta label for search team
Description
Borrowing from the concepts here: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-api-fields I would like to be able to format an IP range field in either a range, or CIDR notation using "fields" in a query, to make the returned data consistent, rather than dependent on how it was indexed.
Since "fields" always returns an array of values, and documents can be indexed with a range that doesn't line up with a single CIDR block
{ "gt": "192.168.1.22", "lte": "192.168.1.37" }
-- those edge cases in "cidr" format should be returned as a deaggreated array of CIDR netblocks like:[ "192.168.1.23/32", "192.168.1.24/29", "192.168.1.32/30", "192.168.1.36/31" ]
. In "range" format it should return an inclusive list as if the document was indexed with "gte" and "lte" -- e.g.[ "192.168.1.23-192.168.1.37" ]
Example mapping:
Example documents:
Example query, showing results today:
Example query, showing desired cidr format functionality:
Example query, showing desired range format functionality:
The text was updated successfully, but these errors were encountered: