# Search on particular field gives no results

**URL:** <https://discuss.elastic.co/t/search-on-particular-field-gives-no-results/20176>\
**Category:** Elasticsearch\
**Created:** [October 10, 2014, 8:05am UTC](https://discuss.elastic.co/t/search-on-particular-field-gives-no-results/20176 "2014-10-10T08:05:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anirudha\_Karwa](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@Anirudha\_Karwa](https://discuss.elastic.co/u/Anirudha_Karwa)\
**Post date:** [October 10, 2014, 8:05am UTC](https://discuss.elastic.co/t/search-on-particular-field-gives-no-results/20176/1 "2014-10-10T08:05:50Z")

</div>

I have a document indexed whose structure is as follows:

{  
"\_index": "yelp",  
"\_type": "user",  
"\_id": "ABC",  
"\_score": 1,  
"\_source": {  
"yelping\_since": "2007-07",  
"votes": {},  
"review\_count": 1798,  
"name": "TEST\_USER",  
"user\_id": "123",  
"friends": [],  
"fans": 89,  
"average\_stars": 3.48,  
"type": "user",  
"compliments": {},  
"elite": []  
}  
}

When I search with ES POST/\_search

{  
"fields" : ["name", "user\_id"],  
"query" : {  
"term" : { "\_id" : "ABC" }  
}  
}

One document is returned.

But when I search for document using a specific field like "user\_id", no documents are fetched.

{  
"fields" : ["name", "user\_id"],  
"query" : {  
"term" : { "user\_id" : "123" }  
}  
}

Any idea why? I have not used any custom mapping while indexing the documents. Any help is appreciated.

--  
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/29a3c2a0-ccc2-488b-96c4-429617defec9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/29a3c2a0-ccc2-488b-96c4-429617defec9%40googlegroups.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, 12:57am UTC](https://discuss.elastic.co/t/search-on-particular-field-gives-no-results/20176/2 "2017-07-06T00:57:08Z")

</div>

Closed on July 6, 2017, 12:57am UTC


