# Filtered Query Standard Analyzer Stopword Problem

**URL:** <https://discuss.elastic.co/t/filtered-query-standard-analyzer-stopword-problem/4320>\
**Category:** Elasticsearch\
**Created:** [April 29, 2011, 4:53pm UTC](https://discuss.elastic.co/t/filtered-query-standard-analyzer-stopword-problem/4320 "2011-04-29T16:53:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![frazer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frazer/32/2752_2.png) [@frazer](https://discuss.elastic.co/u/frazer)\
**Post date:** [April 29, 2011, 4:53pm UTC](https://discuss.elastic.co/t/filtered-query-standard-analyzer-stopword-problem/4320/1 "2011-04-29T16:53:47Z")

</div>

When doing a filtered query search for a stopword I get a shard  
failure error.

Reproducible below.

curl -XPUT '[http://localhost:9200/twitter/tweet/1](http://localhost:9200/twitter/tweet/1)' -d '{  
"user" : "kimchy",  
"post\_date" : "2009-11-15T14:12:12",  
"message" : "trying out Elastic Search"  
}'

curl -XGET '[http://localhost:9200/twitter/\_search?pretty=true](http://localhost:9200/twitter/_search?pretty=true)' -d  
'  
{"query" : { "filtered" : {"query" : {"term" : {"user" : "kimchy"}},  
"filter" : {"and" : [{"term" : {"id" : 1}}, {"query":  
{"query\_string" : { "default\_field": "message", "query" :  
"the"}}} ]}}}}'

{  
"took" : 3,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 4,  
"failed" : 1,  
"failures" : [ {  
"index" : "twitter",  
"shard" : 2,  
"reason" : "QueryPhaseExecutionException[[twitter][2]:  
query[filtered(id:1)-

> org.elasticsearch.common.lucene.search.AndFilter@bf6de680],from[0],size[10]:  
> Query Failed [Failed to execute main query]]; nested: "  
> } ]  
> },  
> "hits" : {  
> "total" : 0,  
> "max\_score" : null,  
> "hits" :   
> }  
> }

If I change my search term to anything other than a stopword all is  
well.

Am I right to assume this is a bug?

Thanks

Frazer

---

<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:** [April 29, 2011, 5:28pm UTC](https://discuss.elastic.co/t/filtered-query-standard-analyzer-stopword-problem/4320/2 "2011-04-29T17:28:30Z")

</div>

Yes, this is a bug, can you open an issue for it?  
On Friday, April 29, 2011 at 7:53 PM, frazer wrote:

> When doing a filtered query search for a stopword I get a shard  
> failure error.
> 
> Reproducible below.
> 
> curl -XPUT '[http://localhost:9200/twitter/tweet/1](http://localhost:9200/twitter/tweet/1)' -d '{  
> "user" : "kimchy",  
> "post\_date" : "2009-11-15T14:12:12",  
> "message" : "trying out Elastic Search"  
> }'
> 
> curl -XGET '[http://localhost:9200/twitter/\_search?pretty=true](http://localhost:9200/twitter/_search?pretty=true)' -d  
> '  
> {"query" : { "filtered" : {"query" : {"term" : {"user" : "kimchy"}},  
> "filter" : {"and" : [{"term" : {"id" : 1}}, {"query":  
> {"query\_string" : { "default\_field": "message", "query" :  
> "the"}}} ]}}}}'
> 
> {  
> "took" : 3,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 4,  
> "failed" : 1,  
> "failures" : [ {  
> "index" : "twitter",  
> "shard" : 2,  
> "reason" : "QueryPhaseExecutionException[[twitter][2]:  
> query[filtered(id:1)-
> 
> > org.elasticsearch.common.lucene.search.AndFilter@bf6de680],from[0],size[10]:  
> > Query Failed [Failed to execute main query]]; nested: "  
> > } ]  
> > },  
> > "hits" : {  
> > "total" : 0,  
> > "max\_score" : null,  
> > "hits" :   
> > }  
> > }
> 
> If I change my search term to anything other than a stopword all is  
> well.
> 
> Am I right to assume this is a bug?
> 
> Thanks
> 
> Frazer

---

<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:** [April 29, 2011, 6:45pm UTC](https://discuss.elastic.co/t/filtered-query-standard-analyzer-stopword-problem/4320/3 "2011-04-29T18:45:31Z")

</div>

Ok, opened an issue for it: [And/Or Filter: Possible failure when inner filter does not match any docs · Issue #892 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/892).  
On Friday, April 29, 2011 at 8:28 PM, Shay Banon wrote:

> Yes, this is a bug, can you open an issue for it?  
> On Friday, April 29, 2011 at 7:53 PM, frazer wrote:
> 
> > When doing a filtered query search for a stopword I get a shard  
> > failure error.
> > 
> > Reproducible below.
> > 
> > curl -XPUT '[http://localhost:9200/twitter/tweet/1](http://localhost:9200/twitter/tweet/1)' -d '{  
> > "user" : "kimchy",  
> > "post\_date" : "2009-11-15T14:12:12",  
> > "message" : "trying out Elastic Search"  
> > }'
> > 
> > curl -XGET '[http://localhost:9200/twitter/\_search?pretty=true](http://localhost:9200/twitter/_search?pretty=true)' -d  
> > '  
> > {"query" : { "filtered" : {"query" : {"term" : {"user" : "kimchy"}},  
> > "filter" : {"and" : [{"term" : {"id" : 1}}, {"query":  
> > {"query\_string" : { "default\_field": "message", "query" :  
> > "the"}}} ]}}}}'
> > 
> > {  
> > "took" : 3,  
> > "timed\_out" : false,  
> > "\_shards" : {  
> > "total" : 5,  
> > ""successful" : 4,  
> > "failed" : 1,  
> > "failures" : [ {  
> > "index" : "twitter",  
> > "shard" : 2,  
> > ""reason" : "QueryPhaseExecutionException[[twitter][2]:  
> > query[filtered(id:1)-
> > 
> > > org.elasticsearch.common.lucene.search.AndFilter@bf6de680],from[0],size[10]:  
> > > Query Failed [Failed to execute main query]]; nested: "  
> > > } ]  
> > > },  
> > > "hits" : {  
> > > "total" : 0,  
> > > "max\_score" : null,  
> > > "hits" :   
> > > }  
> > > }
> > 
> > If I change my search term to anything other than a stopword all is  
> > well.
> > 
> > Am I right to assume this is a bug?
> > 
> > Thanks
> > 
> > Frazer

---

<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, 4:07am UTC](https://discuss.elastic.co/t/filtered-query-standard-analyzer-stopword-problem/4320/4 "2017-07-06T04:07:23Z")

</div>

Closed on July 6, 2017, 4:07am UTC


