# Search api with \_id

**URL:** <https://discuss.elastic.co/t/search-api-with-id/214106>\
**Category:** Elasticsearch\
**Created:** [January 7, 2020, 5:58pm UTC](https://discuss.elastic.co/t/search-api-with-id/214106 "2020-01-07T17:58:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran\_reddy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kiran_reddy1/32/42537_2.png) [@kiran\_reddy1](https://discuss.elastic.co/u/kiran_reddy1)\
**Post date:** [January 7, 2020, 5:58pm UTC](https://discuss.elastic.co/t/search-api-with-id/214106/1 "2020-01-07T17:58:32Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 4, 2020, 5:58pm UTC](https://discuss.elastic.co/t/search-api-with-id/214106/2 "2020-02-04T17:58:41Z")

</div>

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