# Not needed results

**URL:** <https://discuss.elastic.co/t/not-needed-results/63604>\
**Category:** Elasticsearch\
**Created:** [October 21, 2016, 10:30am UTC](https://discuss.elastic.co/t/not-needed-results/63604 "2016-10-21T10:30:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trex/32/34230_2.png) [@trex](https://discuss.elastic.co/u/trex)\
**Post date:** [October 21, 2016, 10:30am UTC](https://discuss.elastic.co/t/not-needed-results/63604/1 "2016-10-21T10:30:34Z")

</div>

Elasticsearch version 2.3.3.

I have a document indexed with `_id`: `506GBBO25953J`. And I want to get **only this one** document. The problem is that I also get 9 other not needed documents.

Query:  
`{"query": {"term": {"_id": "506GBBO25953J"}}}`

Results:

```
grep "_id" /tmp/dump 
      "_id" : "506GBBO25953J",
      "_id" : "404DDCN87823H",
      "_id" : "182JNYT51862G",
      "_id" : "928NSDK72999J",
      "_id" : "880RFWM18773C",
      "_id" : "963WLQD56637O",
      "_id" : "042BRRR44674H",
      "_id" : "905SWQI56804W",
      "_id" : "776DUXN15235Y",
      "_id" : "723CJRP41700R",

```

Also I tried bool query for a field in `_source`, same result.

`{"query": {"bool": {"filter": [{"term": {"ID": "506GBBO25953J"}}]}}}`

Why is that? How to return only one document?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [October 21, 2016, 10:46am UTC](https://discuss.elastic.co/t/not-needed-results/63604/2 "2016-10-21T10:46:32Z")

</div>

An ID is unique within an index and type.  
Not sure what search you ran across what indices there and how you got tmp/dump but normally retrieving documents by ID is done using the full URL e.g.

GET /myindex/mytype/506GBBO25953J

This is not a search operation which is broadcast across all indices and shards. It is a targeted retrieval from exactly one shard using special routing logic. The GET operation is normally exposed by language clients as a get-by-id operation distinct from the search functions.

---

<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:** [July 5, 2017, 10:10pm UTC](https://discuss.elastic.co/t/not-needed-results/63604/3 "2017-07-05T22:10:35Z")

</div>


