# Filtered Query not working with Elasticsearch 1.3.0

**URL:** https://discuss.elastic.co/t/filtered-query-not-working-with-elasticsearch-1-3-0/19793
**Category:** Elasticsearch
**Created:** [September 15, 2014, 4:08pm UTC](https://discuss.elastic.co/t/filtered-query-not-working-with-elasticsearch-1-3-0/19793 "2014-09-15T16:08:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![roopednra](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@roopednra](https://discuss.elastic.co/u/roopednra)
#### Post date: [September 15, 2014, 4:08pm UTC](https://discuss.elastic.co/t/filtered-query-not-working-with-elasticsearch-1-3-0/19793/1 "2014-09-15T16:08:30Z")

</div>

Filtered query not working with _Elasticsearch 1.3.0_. I upgrade  
elasticsearch _0.90.5_ to _1.3.0_.  
I am using elasticsearch below Query DSL. In _Elasticsearch 0.90.5_ below  
query DSL is working fine. But in _Elasticsearch 1.3.0_ getting error _ElasticsearchParseException[Expected  
field name but got START\_OBJECT_

```
{
    "query": {
        "match_all": {},
        "filtered": {
           "filter": {
               "bool": {
                   "must": [
                      {
                          "terms": {
                             "status": [
                                "publish"
                             ]
                          }
                      }
                   ]
               }
           }
        }
    }
}

```

_Complete Error Message:_

```
{

    error: SearchPhaseExecutionException[Failed to execute phase [query

```

], all shards failed; shardFailures {[8FQelETaR22xvV1SvynPEQ][esindex][0]:  
RemoteTransportException[[server1][inet[/127.0.0.1:9300]][search/phase/query  
]]; nested: SearchParseException[[esindex][0]: query[ConstantScore(_:_)],  
from[-1],size[1]: Parse Failure [Failed to parse source [{"size":1,"query":{  
"match\_all":{},"filtered":{"filter":{"bool":{"must":[{"terms":{"status":[  
"publish"]}}]}}}}}]]]; nested: ElasticsearchParseException[Expected field  
name but got START\_OBJECT "filtered"]; }{[8FQelETaR22xvV1SvynPEQ][esindex][1  
]: RemoteTransportException[[server1][inet[/127.0.0.1:9300]][search/phase/  
query]]; nested: SearchParseException[[esindex][1]: query[ConstantScore  
(_:_)],from[-1],size[1]: Parse Failure [Failed to parse source [{"size":1,  
"query":{"match\_all":{},"filtered":{"filter":{"bool":{"must":[{"terms":{  
"status":["publish"]}}]}}}}}]]]; nested: ElasticsearchParseException[  
Expected field name but got START\_OBJECT "filtered"]; }{[  
hZgYLUmsQL2T8z1MY2eyNA][esindex][2]: SearchParseException[[esindex][2]:  
query[ConstantScore(_:_)],from[-1],size[1]: Parse Failure [Failed to parse  
source [{"size":1,"query":{"match\_all":{},"filtered":{"filter":{"bool":{  
"must":[{"terms":{"status":["publish"]}}]}}}}}]]]; nested:  
ElasticsearchParseException[Expected field name but got START\_OBJECT  
"filtered"]; }]  
status: 400

```
}  

```

Any suggestion?

--  
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/032e7ac5-8663-4793-8eec-3661fadceef3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/032e7ac5-8663-4793-8eec-3661fadceef3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 15, 2014, 4:37pm UTC](https://discuss.elastic.co/t/filtered-query-not-working-with-elasticsearch-1-3-0/19793/2 "2014-09-15T16:37:56Z")

</div>

Did you read this?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 15 sept. 2014 à 18:08, Roopendra Vishwakarma [roopendramca@gmail.com](mailto:roopendramca@gmail.com) a écrit :
> 
> Filtered query not working with Elasticsearch 1.3.0. I upgrade elasticsearch 0.90.5 to 1.3.0.  
> I am using elasticsearch below Query DSL. In Elasticsearch 0.90.5 below query DSL is working fine. But in Elasticsearch 1.3.0 getting error ElasticsearchParseException[Expected field name but got START\_OBJECT
> 
> ```
> {
> "query": {
> "match_all": {},
> "filtered": {
> "filter": {
> "bool": {
> "must": [
> {
> "terms": {
> "status": [
> "publish"
> ]
> }
> }
> ]
> }
> }
> }
> }
> }
> 
> ```
> 
> Complete Error Message:
> 
> ```
> {
> 
> error: SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[8FQelETaR22xvV1SvynPEQ][esindex][0]: RemoteTransportException[[server1][inet[/127.0.0.1:9300]][search/phase/query]]; nested: SearchParseException[[esindex][0]: query[ConstantScore(*:*)],from[-1],size[1]: Parse Failure [Failed to parse source [{"size":1,"query":{"match_all":{},"filtered":{"filter":{"bool":{"must":[{"terms":{"status":["publish"]}}]}}}}}]]]; nested: ElasticsearchParseException[Expected field name but got START_OBJECT "filtered"]; }{[8FQelETaR22xvV1SvynPEQ][esindex][1]: RemoteTransportException[[server1][inet[/127.0.0.1:9300]][search/phase/query]]; nested: SearchParseException[[esindex][1]: query[ConstantScore(*:*)],from[-1],size[1]: Parse Failure [Failed to parse source [{"size":1,"query":{"match_all":{},"filtered":{"filter":{"bool":{"must":[{"terms":{"status":["publish"]}}]}}}}}]]]; nested: ElasticsearchParseException[Expected field name but got START_OBJECT "filtered"]; }{[hZgYLUmsQL2T8z1MY2eyNA][esindex][2]: SearchParseException[[esindex][2]: query[ConstantScore(*:*)],from[-1],size[1]: Parse Failure [Failed to parse source [{"size":1,"query":{"match_all":{},"filtered":{"filter":{"bool":{"must":[{"terms":{"status":["publish"]}}]}}}}}]]]; nested: ElasticsearchParseException[Expected field name but got START_OBJECT "filtered"]; }]
> status: 400
> 
> }  
> 
> ```
> 
> ## Any suggestion?
> 
> 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/032e7ac5-8663-4793-8eec-3661fadceef3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/032e7ac5-8663-4793-8eec-3661fadceef3%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/DF1CC3CD-71E0-4DD4-8B62-30BA8286F0C7%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/DF1CC3CD-71E0-4DD4-8B62-30BA8286F0C7%40pilato.fr).  
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, 1:02am UTC](https://discuss.elastic.co/t/filtered-query-not-working-with-elasticsearch-1-3-0/19793/3 "2017-07-06T01:02:14Z")

</div>


