# Filtered query - SearchParseException Parse Failure \[No parser for element...\]

**URL:** https://discuss.elastic.co/t/filtered-query-searchparseexception-parse-failure-no-parser-for-element/12828
**Category:** Elasticsearch
**Created:** [July 17, 2013, 2:39pm UTC](https://discuss.elastic.co/t/filtered-query-searchparseexception-parse-failure-no-parser-for-element/12828 "2013-07-17T14:39:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Joe\_Wong](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@Joe\_Wong](https://discuss.elastic.co/u/Joe_Wong)
#### Post date: [July 17, 2013, 2:39pm UTC](https://discuss.elastic.co/t/filtered-query-searchparseexception-parse-failure-no-parser-for-element/12828/1 "2013-07-17T14:39:17Z")

</div>

for this query

{  
"query":{  
"filtered":{  
"query":{  
"match\_all":{

```
        }
     },
     "filter":{
        "bool":{
           "must":[
              {
                 "term":{
                    "loc":"US"
                 }
              },
              {
                 "range":{
                    "num":{
                       "gt":0
                    }
                 }
              },
              {
                 "terms":{
                    "tlbl":[
                       3
                    ]
                 }
              }
           ]
        }
     }
  },
  "sort":[
     {
        "lbl_3":{
           "order":"desc"
        }
     }
  ],
  "size":100

```

}  
}

I get this error response:  
nested: SearchParseException[[test\_index][5]:  
query[ConstantScore(NotDeleted(BooleanFilter( +cache(loc:US) +cache(num:{0  
TO \*]) +cache(tlbl:`\b\u0000\u0000\u0000\u0003))))],from[-1],size[-1]:  
Parse Failure [No parser for element [lbl\_3]]]; }]",

However with this query there is no error and documents are returned:

{  
"query":{  
"match\_all":{

```
  }

```

},  
"filter":{  
"bool":{  
"must":[  
{  
"term":{  
"loc":"US"  
}  
},  
{  
"range":{  
"num":{  
"gt":0  
}  
}  
},  
{  
"terms":{  
"tlbl":[  
3  
]  
}  
}  
]  
}  
},  
"sort":[  
{  
"lbl\_3":{  
"order":"desc"  
}  
}  
],  
"size":100  
}

"lbl\_3" is mapped in the index as integer type, include\_in\_all false and  
not analyzed. Not every document will have data for this field. I'm running  
0.90.2.

thanks

--  
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: ![Joe\_Wong](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@Joe\_Wong](https://discuss.elastic.co/u/Joe_Wong)
#### Post date: [July 17, 2013, 10:13pm UTC](https://discuss.elastic.co/t/filtered-query-searchparseexception-parse-failure-no-parser-for-element/12828/2 "2013-07-17T22:13:30Z")

</div>

My closing bracket for the top "query" is in the wrong spot. I corrected it  
and it works

On Wednesday, July 17, 2013 10:39:17 AM UTC-4, Joe Wong wrote:

> for this query
> 
> {  
> "query":{  
> "filtered":{  
> "query":{  
> "match\_all":{
> 
> ```
> }
> },
> "filter":{
> "bool":{
> "must":[
> {
> "term":{
> "loc":"US"
> }
> },
> {
> "range":{
> "num":{
> "gt":0
> }
> }
> },
> {
> "terms":{
> "tlbl":[
> 3
> ]
> }
> }
> ]
> }
> }
> },
> "sort":[
> {
> "lbl_3":{
> "order":"desc"
> }
> }
> ],
> "size":100
> 
> ```
> 
> }  
> }
> 
> I get this error response:  
> nested: SearchParseException[[test\_index][5]:  
> query[ConstantScore(NotDeleted(BooleanFilter( +cache(loc:US) +cache(num:{0  
> TO \*]) +cache(tlbl:`\b\u0000\u0000\u0000\u0003))))],from[-1],size[-1]:  
> Parse Failure [No parser for element [lbl\_3]]]; }]",
> 
> However with this query there is no error and documents are returned:
> 
> {  
> "query":{  
> "match\_all":{
> 
> ```
> }
> 
> ```
> 
> },  
> "filter":{  
> "bool":{  
> "must":[  
> {  
> "term":{  
> "loc":"US"  
> }  
> },  
> {  
> "range":{  
> "num":{  
> "gt":0  
> }  
> }  
> },  
> {  
> "terms":{  
> "tlbl":[  
> 3  
> ]  
> }  
> }  
> ]  
> }  
> },  
> "sort":[  
> {  
> "lbl\_3":{  
> "order":"desc"  
> }  
> }  
> ],  
> "size":100  
> }
> 
> "lbl\_3" is mapped in the index as integer type, include\_in\_all false and  
> not analyzed. Not every document will have data for this field. I'm  
> running 0.90.2.
> 
> thanks

--  
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:25am UTC](https://discuss.elastic.co/t/filtered-query-searchparseexception-parse-failure-no-parser-for-element/12828/3 "2017-07-06T02:25:50Z")

</div>


