Search api with _id

Hi Team,

i am trying to experiment on the nested query https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html

I am able to get the query working the way i needed to:

GET my_index/_search
{
  "_source": "false", 
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "_id": {
              "value": "1"
            }
          }
        },
        {
          "nested": {
            "path": "user",
            "query": {
              "bool": {
                "filter": [
                  {
                    "match": {
                      "user.first": "Alice"
                    }
                  },
                  {
                    "match": {
                      "user.last": "White"
                    }
                  }
                ]
              }
            },
            "inner_hits": {}
          }
        }
      ]
    }
  }
}

Two questions :

  • Are there any performance improvements by using id in the search request apart from the unique document search ?
  • Is there a way to get the data in to hits rather than innerhits, read the documentation , couldnt find a example for mapping it back and has performance hit in calculating nested documents on large indexes.

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