# Get by \_id doesn't work but search does

**URL:** <https://discuss.elastic.co/t/get-by--id-doesnt-work-but-search-does/17927>\
**Category:** Elasticsearch\
**Created:** [June 5, 2014, 11:54am UTC](https://discuss.elastic.co/t/get-by--id-doesnt-work-but-search-does/17927 "2014-06-05T11:54:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luke\_Wilson\_Mawer](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@Luke\_Wilson\_Mawer](https://discuss.elastic.co/u/Luke_Wilson_Mawer)\
**Post date:** [June 5, 2014, 11:54am UTC](https://discuss.elastic.co/t/get-by--id-doesnt-work-but-search-does/17927/1 "2014-06-05T11:54:34Z")

</div>

Hi,

I'm seeing weird behaviours with ids on elasticsearch 1.2.0 (recently  
upgraded from 1.0.1).

A search retrieves my document, showing the correct value for \_id:

[terminal] curl 'myServer:9200/global/\_search?q=someField:something  
{"took":79,"timed\_out":false,"\_shards":{"total":12,"successful":12,"failed":0},"hits":{"total":1,"max\_score":17.715034,"hits":[{"\_index":"global","\_type":"user","\_id":"7a113e4f-44de-3b2b-a3f1-fb881da1b00a",...

But a direct lookup on id doesn't:  
[terminal] curl  
'myServer:9200/global/user/7a113e4f-44de-3b2b-a3f1-fb881da1b00a'  
{"\_index":"global","\_type":"user","\_id":"7a113e4f-44de-3b2b-a3f1-fb881da1b00a","found":false}

Any ideas? I'm hoping I won't have to reindex...

Kind regards,

Luke

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [June 5, 2014, 12:34pm UTC](https://discuss.elastic.co/t/get-by--id-doesnt-work-but-search-does/17927/2 "2014-06-05T12:34:31Z")

</div>

Hi,

This is very likely because of

> <https://github.com/elastic/elasticsearch/pull/6393>
>
> Routing has been inadvertly changed in #5562 resulting in documents going to
> dif…ferent shards in 1.2. This is a terrible bug because an indexing request
> would not necessarily go to the same shard anymore, potentially leading to
> duplicates.
> 
> Close #6391

See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/elasticsearch-1-2-1-released/) for  
more information, we are currently working on a tool that would help  
relocate documents to the right shard.

On Thu, Jun 5, 2014 at 1:54 PM, Luke Wilson-Mawer \<[lukewilsonmawer@gmail.com](mailto:lukewilsonmawer@gmail.com)

> wrote:

> Hi,
> 
> I'm seeing weird behaviours with ids on elasticsearch 1.2.0 (recently  
> upgraded from 1.0.1).
> 
> A search retrieves my document, showing the correct value for \_id:
> 
> [terminal] curl 'myServer:9200/global/\_search?q=someField:something
> 
> {"took":79,"timed\_out":false,"\_shards":{"total":12,"successful":12,"failed":0},"hits":{"total":1,"max\_score":17.715034,"hits":[{"\_index":"global","\_type":"user","\_id":"7a113e4f-44de-3b2b-a3f1-fb881da1b00a",...
> 
> But a direct lookup on id doesn't:  
> [terminal] curl  
> 'myServer:9200/global/user/7a113e4f-44de-3b2b-a3f1-fb881da1b00a'
> 
> {"\_index":"global","\_type":"user","\_id":"7a113e4f-44de-3b2b-a3f1-fb881da1b00a","found":false}
> 
> Any ideas? I'm hoping I won't have to reindex...
> 
> Kind regards,
> 
> Luke
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Luke\_Wilson\_Mawer](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@Luke\_Wilson\_Mawer](https://discuss.elastic.co/u/Luke_Wilson_Mawer)\
**Post date:** [June 6, 2014, 9:24am UTC](https://discuss.elastic.co/t/get-by--id-doesnt-work-but-search-does/17927/3 "2014-06-06T09:24:33Z")

</div>

Great, thanks Adrien. I will eagerly await the tool.

Kind regards,

Luke

On Thu, Jun 5, 2014 at 1:34 PM, Adrien Grand \<[adrien.grand@elasticsearch.com](mailto:adrien.grand@elasticsearch.com)

> wrote:

> Hi,
> 
> This is very likely because of  
> [Restore shard routing. by jpountz · Pull Request #6393 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/pull/6393)
> 
> See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/elasticsearch-1-2-1-released/) for  
> more information, we are currently working on a tool that would help  
> relocate documents to the right shard.
> 
> On Thu, Jun 5, 2014 at 1:54 PM, Luke Wilson-Mawer \<  
> [lukewilsonmawer@gmail.com](mailto:lukewilsonmawer@gmail.com)\> wrote:
> 
> > Hi,
> > 
> > I'm seeing weird behaviours with ids on elasticsearch 1.2.0 (recently  
> > upgraded from 1.0.1).
> > 
> > A search retrieves my document, showing the correct value for \_id:
> > 
> > [terminal] curl 'myServer:9200/global/\_search?q=someField:something
> > 
> > {"took":79,"timed\_out":false,"\_shards":{"total":12,"successful":12,"failed":0},"hits":{"total":1,"max\_score":17.715034,"hits":[{"\_index":"global","\_type":"user","\_id":"7a113e4f-44de-3b2b-a3f1-fb881da1b00a",...
> > 
> > But a direct lookup on id doesn't:  
> > [terminal] curl  
> > 'myServer:9200/global/user/7a113e4f-44de-3b2b-a3f1-fb881da1b00a'
> > 
> > {"\_index":"global","\_type":"user","\_id":"7a113e4f-44de-3b2b-a3f1-fb881da1b00a","found":false}
> > 
> > Any ideas? I'm hoping I won't have to reindex...
> > 
> > Kind regards,
> > 
> > Luke
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > 
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Adrien Grand
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/B2dlshf\_dQI/unsubscribe](https://groups.google.com/d/topic/elasticsearch/B2dlshf_dQI/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKmH%2BjqgLZ6-qBHPvKbWLAbBiP\_jqjt8QJ7kPWhSATKch0d4Bw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKmH%2BjqgLZ6-qBHPvKbWLAbBiP_jqjt8QJ7kPWhSATKch0d4Bw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 6, 2014, 9:58am UTC](https://discuss.elastic.co/t/get-by--id-doesnt-work-but-search-does/17927/4 "2014-06-06T09:58:50Z")

</div>

Look here for the tool and how to use it

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Jörg

On Fri, Jun 6, 2014 at 11:24 AM, Luke Wilson-Mawer \<  
[lukewilsonmawer@gmail.com](mailto:lukewilsonmawer@gmail.com)\> wrote:

> Great, thanks Adrien. I will eagerly await the tool.
> 
> Kind regards,
> 
> Luke
> 
> On Thu, Jun 5, 2014 at 1:34 PM, Adrien Grand \<  
> [adrien.grand@elasticsearch.com](mailto:adrien.grand@elasticsearch.com)\> wrote:
> 
> > Hi,
> > 
> > This is very likely because of  
> > [Restore shard routing. by jpountz · Pull Request #6393 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/pull/6393)
> > 
> > See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/elasticsearch-1-2-1-released/) for  
> > more information, we are currently working on a tool that would help  
> > relocate documents to the right shard.
> > 
> > On Thu, Jun 5, 2014 at 1:54 PM, Luke Wilson-Mawer \<  
> > [lukewilsonmawer@gmail.com](mailto:lukewilsonmawer@gmail.com)\> wrote:
> > 
> > > Hi,
> > > 
> > > I'm seeing weird behaviours with ids on elasticsearch 1.2.0 (recently  
> > > upgraded from 1.0.1).
> > > 
> > > A search retrieves my document, showing the correct value for \_id:
> > > 
> > > [terminal] curl 'myServer:9200/global/\_search?q=someField:something
> > > 
> > > {"took":79,"timed\_out":false,"\_shards":{"total":12,"successful":12,"failed":0},"hits":{"total":1,"max\_score":17.715034,"hits":[{"\_index":"global","\_type":"user","\_id":"7a113e4f-44de-3b2b-a3f1-fb881da1b00a",...
> > > 
> > > But a direct lookup on id doesn't:  
> > > [terminal] curl  
> > > 'myServer:9200/global/user/7a113e4f-44de-3b2b-a3f1-fb881da1b00a'
> > > 
> > > {"\_index":"global","\_type":"user","\_id":"7a113e4f-44de-3b2b-a3f1-fb881da1b00a","found":false}
> > > 
> > > Any ideas? I'm hoping I won't have to reindex...
> > > 
> > > Kind regards,
> > > 
> > > Luke
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > > 
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0c68f79-12fc-42e9-9a26-102c3b75f42e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > Adrien Grand
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/B2dlshf\_dQI/unsubscribe](https://groups.google.com/d/topic/elasticsearch/B2dlshf_dQI/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6JRYTe01iXb4Lwdurxgmfp6QTXfmEBbA%2Bmci8cQMGZ-A%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAKmH%2BjqgLZ6-qBHPvKbWLAbBiP\_jqjt8QJ7kPWhSATKch0d4Bw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKmH%2BjqgLZ6-qBHPvKbWLAbBiP_jqjt8QJ7kPWhSATKch0d4Bw%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAKmH%2BjqgLZ6-qBHPvKbWLAbBiP\_jqjt8QJ7kPWhSATKch0d4Bw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKmH%2BjqgLZ6-qBHPvKbWLAbBiP_jqjt8QJ7kPWhSATKch0d4Bw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGHObFxwXcQx7c66cN1a7S%2BeOj152ETQPV6%2B%2Bii6cgkhA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGHObFxwXcQx7c66cN1a7S%2BeOj152ETQPV6%2B%2Bii6cgkhA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:24am UTC](https://discuss.elastic.co/t/get-by--id-doesnt-work-but-search-does/17927/5 "2017-07-06T01:24:12Z")

</div>


