# Filters is not working for a particular index

**URL:** <https://discuss.elastic.co/t/filters-is-not-working-for-a-particular-index/11046>\
**Category:** Elasticsearch\
**Created:** [March 7, 2013, 5:45am UTC](https://discuss.elastic.co/t/filters-is-not-working-for-a-particular-index/11046 "2013-03-07T05:45:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moocow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moocow/32/2454_2.png) [@moocow](https://discuss.elastic.co/u/moocow)\
**Post date:** [March 7, 2013, 5:45am UTC](https://discuss.elastic.co/t/filters-is-not-working-for-a-particular-index/11046/1 "2013-03-07T05:45:39Z")

</div>

Hello there,

I'm finding that a query is not working for a particular index and type,  
but works for something else.

It is as follows. I have created items/item like so. and same with  
users/user (just index/type name changed)

curl -XPUT [http://localhost:9200/items](http://localhost:9200/items) -d '  
{  
"settings" : {  
"analysis" : {  
"analyzer" : {  
"stem" : {  
"tokenizer" : "standard",  
"filter" : ["standard", "lowercase", "stop",  
"porterStem"]  
}  
}  
}  
},  
"mappings" : {  
"item" : {  
"dynamic" : true,  
"properties" : {  
"default" : {  
"type" : "string",  
"analyzer" : "stem"  
}  
}  
}  
}  
}'

I'm using filters to query users like so (WORKS YIELDS 2 HITS LIKE IT  
SHOULD)

curl -XGET '[http://localhost:9200/users/user/\_search?pretty=true](http://localhost:9200/users/user/_search?pretty=true)' -d  
'{"query":  
{"constant\_score":{ "filter": {"terms":{"fb\_id":["aaaa",  
"bbbb"],"execution":"bool"}} }}}'

then i do the same thing for items like so (YIELDS 0 HITS)  
curl -XGET '[http://localhost:9200/items/item/\_search?pretty=true](http://localhost:9200/items/item/_search?pretty=true)' -d  
'{"query":  
{"constant\_score":{ "filter":  
{"terms":{"list\_key":["aaa"],"execution":"bool"}} }}}'

When i search using below, I can see that the item is in there  
curl -XGET '[http://localhost:9200/items/item/\_search?pretty=true&q=](http://localhost:9200/items/item/_search?pretty=true&q=)_:_'

{  
"\_index" : "items",  
"\_type" : "item",  
"\_id" : "someid",  
"\_score" : 1.0, "\_source" : {"d\_added": 1360829619000.0, "p": 2,  
"list\_key": "aaa", "key": "someid"}

I'm completely at a loss here why it works for one, and not the other.

any helps 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).  
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:47am UTC](https://discuss.elastic.co/t/filters-is-not-working-for-a-particular-index/11046/2 "2017-07-06T02:47:52Z")

</div>

Closed on July 6, 2017, 2:47am UTC


