In given query I tried all possible combination already nathing worked and ipToLong and ipForLong are just long variable then what do u mean by intervals here and again I tried all combination include_lower and include_upper .one more thing ,putting my point again If you run this clauses of range in two different bool queries this works and I menton again both are different fields if you run in single then doesn't so fliping should have no mean with it.
I tried the following example based on what you wrote. That's the typical script which could help. So please, next time, provide such a script. It's easy to read and understand what you are doing.
DELETE test
PUT test
{
"mappings": {
"properties": {
"ipFromLong": {
"type": "long"
},
"ipToLong": {
"type": "long"
}
}
}
}
POST test/_doc
{
"ipToLong": 28147177550,
"ipFromLong": 28147177543
}
This one gives no hit. Why this? Because for ipFromLong 28147177543 < 28147177551. So it can't match.
That's why your query can not match anything.
I'm now trying to understand what exactly you want to do actually.
And I wonder if you are trying to find values in intervals. In which case, I'd highly recommend using:
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.