ElasticSearch is used in a lot of networking systems to collect and search logs, such as Kibana (http://kibana.org/) and LogStash (http://logstash.net/). To improve search in these scenarios, it provides the IPv4 type that can be used to store an IP address in an optimized way.
You need to define the type of the field that contains IP address as "ip"
.
Using the above order example we can extend it by adding the customer IP address with the following code snippet:
"customer_ip": { "type": "ip", "store": "yes", "index": "yes" }
The IP must be in the standard point notation form, as follows:
"customer_ip":"19.18.200.201"