How to filter between a particular id range


#1

Before Elasticsearch 5, we were able to filter

   {
      "query": {
          "bool": {
             "filter": [
                 {
                    "range" : {
                        "_uid" : {
                            "gte" : "item#1600000",
                            "lte" :"item#1600100"
                        }
                    }
                 }
            ]
          }
       }
    }

However with Elasticsearch 5, it seems we are not able to do filter range and not able to perform range on uid.
The closest direction has been to look at Ids query. However, it seems like there is no way to specify ids greater than or lesser than.


(Adrien Grand) #2

That is not possible anymore indeed. One alternative would be to also add the id as a keyword field in your documents, and use that keyword field for the range query.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.