# Search stops after the first match

**URL:** <https://discuss.elastic.co/t/search-stops-after-the-first-match/7909>\
**Category:** Elasticsearch\
**Created:** [May 30, 2012, 11:13am UTC](https://discuss.elastic.co/t/search-stops-after-the-first-match/7909 "2012-05-30T11:13:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vipul](https://avatars.discourse-cdn.com/v4/letter/v/cdc98d/32.png) [@Vipul](https://discuss.elastic.co/u/Vipul)\
**Post date:** [May 30, 2012, 11:13am UTC](https://discuss.elastic.co/t/search-stops-after-the-first-match/7909/1 "2012-05-30T11:13:38Z")

</div>

I have attribute\_set\_id indexed at two different places in each id. I  
want to search and get results from both the places(actually I want  
from the second one). What is happening now, is that the following  
query searches only for the first instance of "attribute\_set\_id" and  
when does not find the match, returns zero.  
{"query":{terms:{attribute\_set\_id:["Bags"]}}}'

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 3, 2012, 9:05am UTC](https://discuss.elastic.co/t/search-stops-after-the-first-match/7909/2 "2012-06-03T09:05:51Z")

</div>

Can you share more information?

On Wed, May 30, 2012 at 1:13 PM, Vipul Jain [awesomevipul@gmail.com](mailto:awesomevipul@gmail.com) wrote:

> I have attribute\_set\_id indexed at two different places in each id. I  
> want to search and get results from both the places(actually I want  
> from the second one). What is happening now, is that the following  
> query searches only for the first instance of "attribute\_set\_id" and  
> when does not find the match, returns zero.  
> {"query":{terms:{attribute\_set\_id:["Bags"]}}}'

---

<div class="post-metadata">

**Author:** ![Vipul](https://avatars.discourse-cdn.com/v4/letter/v/cdc98d/32.png) [@Vipul](https://discuss.elastic.co/u/Vipul)\
**Post date:** [June 4, 2012, 6:52am UTC](https://discuss.elastic.co/t/search-stops-after-the-first-match/7909/3 "2012-06-04T06:52:18Z")

</div>

Could you please look at this link:

> <https://stackoverflow.com/questions/10876548/not-getting-all-the-results>

On Sunday, 3 June 2012 14:35:51 UTC+5:30, kimchy wrote:

> Can you share more information?
> 
> On Wed, May 30, 2012 at 1:13 PM, Vipul Jain [awesomevipul@gmail.com](mailto:awesomevipul@gmail.com)wrote:
> 
> > I have attribute\_set\_id indexed at two different places in each id. I  
> > want to search and get results from both the places(actually I want  
> > from the second one). What is happening now, is that the following  
> > query searches only for the first instance of "attribute\_set\_id" and  
> > when does not find the match, returns zero.  
> > {"query":{terms:{attribute\_set\_id:["Bags"]}}}'

---

<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, 3:25am UTC](https://discuss.elastic.co/t/search-stops-after-the-first-match/7909/4 "2017-07-06T03:25:47Z")

</div>

Closed on July 6, 2017, 3:25am UTC


