I am trying to get an IP range request to work on a set of documents and I am not getting any results.
Mapping (I tried both analyzed, and not_analyzed):
"mappings": {
"addy": {
"properties": {
"add": {
"type": "ip",
"not_analyzed":"true"
}
}
}
}
The data looks like this (many examples of this with different meanings)
"_source": {
"add": "192.168.1.15"
}
Now I looked at the ES official docs, but there was no example of an IP range, but I found it on Git that didn't work. It looks like this:
"query": {
"query_string": {
"default_field": "add",
"query": "add:[192.168.1.5 TO 192.168.1.15]"
}
}
The above encouraged parsing errors when I was fat, sorting through my fields and addresses, but in the end did not give any results.
I also tried the standard range syntax:
"filter": {
"range": {
"add": {
"from": "192.168.1.5",
"to": "192.168.1.25"
}
}
}
Which also did not give any results. How to request a range of IP addresses?
source
share