Term query can't not apply to "id" field?

when I use below query, no result return:

{
  "query" : {
    "term" : {
      "id" : {
        "value" : "abcdef",
        "boost" : 1.0
      }
    }
  },
  "ext" : { }
}

but when I use ids query, the return result is fine:

{
    "query": {
        "ids" : {
            "type" : "trip",
            "values" : ["abcdef"]
        }
    }
}

My questions are: term query can't not apply to "id" field? Must I use ids query? Is there a better way to search an id in multiple indices?

Hey,

id just refers to a field named id inside of your document JSON. I guess you want to query the _id field.

--Alex

That's true. Thanks for helping.

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