I have a elasticsearch index with a ip address field in the mapping:
"address" : {
"type" : "ip"
},
I need to know if I can search for any ip byte component, for example, having a document with ip "172.13.200.1", I make a query searching for byte '200', I need to get all documents with:
For the use case mentioned at the start, the position is not relevant. That's why I suggested this approach.
Otherwise, in addition to @leandrojmp solution, it's possible to index it as a keyword and run a "slow" regex. But I definitely prefer splitting in 4 fields. Much faster at search time!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.