# Retrieving results based on key search (vs content)

**URL:** <https://discuss.elastic.co/t/retrieving-results-based-on-key-search-vs-content/13439>\
**Category:** Elasticsearch\
**Created:** [September 3, 2013, 3:47am UTC](https://discuss.elastic.co/t/retrieving-results-based-on-key-search-vs-content/13439 "2013-09-03T03:47:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gautam\_singhania](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gautam\_singhania](https://discuss.elastic.co/u/gautam_singhania)\
**Post date:** [September 3, 2013, 3:47am UTC](https://discuss.elastic.co/t/retrieving-results-based-on-key-search-vs-content/13439/1 "2013-09-03T03:47:07Z")

</div>

Hi

This might be an obvious question, but i cannot figure it out

i am adding json objrcts to index search using the commandline bulk load  
feature.

the id of each file is a string. (like brad-pitt)

when i do a search, i get back al json objects that have brad-pitt in them,  
how do i get the one record whose id was 'brad-pitt'

looks like id is not indexed, which setting letsc me do that?

thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![ddorian43](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ddorian43/32/36093_2.png) [@ddorian43](https://discuss.elastic.co/u/ddorian43)\
**Post date:** [September 3, 2013, 8:52am UTC](https://discuss.elastic.co/t/retrieving-results-based-on-key-search-vs-content/13439/2 "2013-09-03T08:52:51Z")

</div>

If you don't specify in the mapping the id of the documents (  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/id-field/)) then an  
automatic id is created . To get a document from id see:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/get/)

On Tuesday, September 3, 2013 5:47:07 AM UTC+2, gautam singhania wrote:

> Hi
> 
> This might be an obvious question, but i cannot figure it out
> 
> i am adding json objrcts to index search using the commandline bulk load  
> feature.
> 
> the id of each file is a string. (like brad-pitt)
> 
> when i do a search, i get back al json objects that have brad-pitt in  
> them, how do i get the one record whose id was 'brad-pitt'
> 
> looks like id is not indexed, which setting letsc me do that?
> 
> thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![gautam\_singhania](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gautam\_singhania](https://discuss.elastic.co/u/gautam_singhania)\
**Post date:** [September 4, 2013, 12:55am UTC](https://discuss.elastic.co/t/retrieving-results-based-on-key-search-vs-content/13439/3 "2013-09-04T00:55:30Z")

</div>

Hi

Thanks for the reply

I am generating the id and adding it to Id field

My problem is that when I search on a term it gets searched on the content  
not the I'd of the content

Thanks

On Tuesday, September 3, 2013, ddorian43 wrote:

> If you don't specify in the mapping the id of the documents (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/id-field/)) then an  
> automatic id is created . To get a document from id see:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/get/)
> 
> On Tuesday, September 3, 2013 5:47:07 AM UTC+2, gautam singhania wrote:
> 
> > Hi
> > 
> > This might be an obvious question, but i cannot figure it out
> > 
> > i am adding json objrcts to index search using the commandline bulk load  
> > feature.
> > 
> > the id of each file is a string. (like brad-pitt)
> > 
> > when i do a search, i get back al json objects that have brad-pitt in  
> > them, how do i get the one record whose id was 'brad-pitt'
> > 
> > looks like id is not indexed, which setting letsc me do that?
> > 
> > thanks
> > 
> > --  
> > 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/2ZF2DHUEZ\_I/unsubscribe](https://groups.google.com/d/topic/elasticsearch/2ZF2DHUEZ_I/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) \<javascript:\_e({}, 'cvml',  
> > 'elasticsearch%2Bunsubscribe@googlegroups.com');\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![ddorian43](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ddorian43/32/36093_2.png) [@ddorian43](https://discuss.elastic.co/u/ddorian43)\
**Post date:** [September 4, 2013, 8:29am UTC](https://discuss.elastic.co/t/retrieving-results-based-on-key-search-vs-content/13439/4 "2013-09-04T08:29:20Z")

</div>

So, do you need anything more? You can use the 'get' api that i linked  
before.

On Wed, Sep 4, 2013 at 2:55 AM, gautam singhania [gautamsa79@gmail.com](mailto:gautamsa79@gmail.com)wrote:

> Hi
> 
> Thanks for the reply
> 
> I am generating the id and adding it to Id field
> 
> My problem is that when I search on a term it gets searched on the content  
> not the I'd of the content
> 
> Thanks
> 
> On Tuesday, September 3, 2013, ddorian43 wrote:
> 
> > If you don't specify in the mapping the id of the documents (  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/id-field/)) then an  
> > automatic id is created . To get a document from id see:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/get/)
> > 
> > On Tuesday, September 3, 2013 5:47:07 AM UTC+2, gautam singhania wrote:
> > 
> > > Hi
> > > 
> > > This might be an obvious question, but i cannot figure it out
> > > 
> > > i am adding json objrcts to index search using the commandline bulk  
> > > load feature.
> > > 
> > > the id of each file is a string. (like brad-pitt)
> > > 
> > > when i do a search, i get back al json objects that have brad-pitt in  
> > > them, how do i get the one record whose id was 'brad-pitt'
> > > 
> > > looks like id is not indexed, which setting letsc me do that?
> > > 
> > > thanks
> > > 
> > > --  
> > > 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/2ZF2DHUEZ\_I/unsubscribe](https://groups.google.com/d/topic/elasticsearch/2ZF2DHUEZ_I/unsubscribe).  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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/2ZF2DHUEZ\_I/unsubscribe](https://groups.google.com/d/topic/elasticsearch/2ZF2DHUEZ_I/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:18am UTC](https://discuss.elastic.co/t/retrieving-results-based-on-key-search-vs-content/13439/5 "2017-07-06T02:18:19Z")

</div>


