# Parse Failure \[No parser for element \[query\_string\]\]

**URL:** <https://discuss.elastic.co/t/parse-failure-no-parser-for-element-query-string/8398>\
**Category:** Elasticsearch\
**Created:** [July 12, 2012, 2:21pm UTC](https://discuss.elastic.co/t/parse-failure-no-parser-for-element-query-string/8398 "2012-07-12T14:21:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [July 12, 2012, 2:21pm UTC](https://discuss.elastic.co/t/parse-failure-no-parser-for-element-query-string/8398/1 "2012-07-12T14:21:12Z")

</div>

Hi, I have an index with this configuration for analyzer:

{  
"albums" : {  
"settings" : {  
"index.analysis.analyzer.text\_en.filter.2" : "porterStem",  
"index.analysis.analyzer.text\_en.filter.1" : "lowercase",  
"index.analysis.analyzer.text\_en.filter.0" : "standard",  
"index.analysis.analyzer.text\_en.tokenizer" : "standard",  
"index.analysis.analyzer.text\_en.type" : "custom",  
"index.number\_of\_shards" : "1",  
"index.number\_of\_replicas" : "0",  
"index.version.created" : "190899"  
}  
}  
}

When I run this query:

curl -XGET  
'[http://localhost:9200/albums/album/\_search?pretty=true&explain=true](http://localhost:9200/albums/album/_search?pretty=true&explain=true)' -d '  
{  
"query\_string" : {  
"fields" : ["artist", "album^5"],  
"query" : "adele 21",  
"use\_dis\_max" : true  
}  
}  
'

I'm getting back an exception on No Parser for element:

[2012-07-12 10:16:58,056][DEBUG][action.search.type] [Snowfall]  
[albums][0], node[CooohIbFS7WDcvgkkgH\_jg], [P], s[STARTED]: Failed to  
execute [org.elasticsearch.action.search.SearchRequest@31ad557c]  
org.elasticsearch.search.SearchParseException: [albums][0]:  
from[-1],size[-1]: Parse Failure [Failed to parse source [  
{  
"query\_string" : {  
"fields" : ["artist", "album^5"],  
"query" : "adele 21",  
"use\_dis\_max" : true  
}  
}  
]]  
at  
org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)  
at  
org.elasticsearch.search.SearchService.createContext(SearchService.java:469)  
at  
org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:301)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:242)  
at  
org.elasticsearch.action.search.type.TransportSearchQueryAndFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryAndFetchAction.java:75)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:680)  
Caused by: org.elasticsearch.search.SearchParseException: [albums][0]:  
from[-1],size[-1]: Parse Failure [No parser for element [query\_string]]  
at  
org.elasticsearch.search.SearchService.parseSource(SearchService.java:543)  
... 10 more

Why is that? Is this an issue with snowball analyzer?

Regards

---

<div class="post-metadata">

**Author:** ![Shairon\_Toledo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shairon_toledo/32/2490_2.png) [@Shairon\_Toledo](https://discuss.elastic.co/u/Shairon_Toledo)\
**Post date:** [July 12, 2012, 2:43pm UTC](https://discuss.elastic.co/t/parse-failure-no-parser-for-element-query-string/8398/2 "2012-07-12T14:43:48Z")

</div>

You should surround "query\_string" with "query", this way

curl -XGET '  
[http://localhost:9200/albums/album/\_search?pretty=true&explain=true](http://localhost:9200/albums/album/_search?pretty=true&explain=true)' -d '  
{  
"query":{  
"query\_string" : {  
"fields" : ["artist", "album^5"],  
"query" : "adele 21",  
"use\_dis\_max" : true  
}  
}  
}  
'

On Thu, Jul 12, 2012 at 11:21 AM, Vinicius Carvalho \<  
[viniciusccarvalho@gmail.com](mailto:viniciusccarvalho@gmail.com)\> wrote:

> Hi, I have an index with this configuration for analyzer:
> 
> {  
> "albums" : {  
> "settings" : {  
> "index.analysis.analyzer.text\_en.filter.2" : "porterStem",  
> "index.analysis.analyzer.text\_en.filter.1" : "lowercase",  
> "index.analysis.analyzer.text\_en.filter.0" : "standard",  
> "index.analysis.analyzer.text\_en.tokenizer" : "standard",  
> "index.analysis.analyzer.text\_en.type" : "custom",  
> "index.number\_of\_shards" : "1",  
> "index.number\_of\_replicas" : "0",  
> "index.version.created" : "190899"  
> }  
> }  
> }
> 
> When I run this query:
> 
> curl -XGET '  
> [http://localhost:9200/albums/album/\_search?pretty=true&explain=true](http://localhost:9200/albums/album/_search?pretty=true&explain=true)' -d '  
> {  
> "query\_string" : {  
> "fields" : ["artist", "album^5"],  
> "query" : "adele 21",  
> "use\_dis\_max" : true  
> }  
> }  
> '
> 
> I'm getting back an exception on No Parser for element:
> 
> [2012-07-12 10:16:58,056][DEBUG][action.search.type] [Snowfall]  
> [albums][0], node[CooohIbFS7WDcvgkkgH\_jg], [P], s[STARTED]: Failed to  
> execute [org.elasticsearch.action.search.SearchRequest@31ad557c]  
> org.elasticsearch.search.SearchParseException: [albums][0]:  
> from[-1],size[-1]: Parse Failure [Failed to parse source [  
> {  
> "query\_string" : {  
> "fields" : ["artist", "album^5"],  
> "query" : "adele 21",  
> "use\_dis\_max" : true  
> }  
> }  
> ]]  
> at  
> org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)  
> at  
> org.elasticsearch.search.SearchService.createContext(SearchService.java:469)  
> at  
> org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:301)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:242)  
> at  
> org.elasticsearch.action.search.type.TransportSearchQueryAndFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryAndFetchAction.java:75)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:680)  
> Caused by: org.elasticsearch.search.SearchParseException: [albums][0]:  
> from[-1],size[-1]: Parse Failure [No parser for element [query\_string]]  
> at  
> org.elasticsearch.search.SearchService.parseSource(SearchService.java:543)  
> ... 10 more
> 
> Why is that? Is this an issue with snowball analyzer?
> 
> Regards

--

Shairon Toledo

> **[Microsoft Developer News | C++,C# & .NET Framework & More | CodeGuru](http://hashcode.me)**
>
> 您是否想要找关于幸运飞行艇 官方开奖历史记录 168飞艇全国统一开奖数据 还有幸运飞行艇官方开奖现场直播 幸运168飞艇全天精准稳定计划 这里都能一一提供。CodeGuru is where developers come to share ideas, articles, questions, answers, tips, tricks, comments, downloads, and more related to programming in areas including C++,...

---

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [July 12, 2012, 2:49pm UTC](https://discuss.elastic.co/t/parse-failure-no-parser-for-element-query-string/8398/3 "2012-07-12T14:49:24Z")

</div>

DOUH!

Thanks dude! BTW would be nice to add this to the QueryDSL page, I just  
copied from there, I know it was my mistake, but one need to consider  
adding surrounding query to the examples on the page.

Many thanks

On Thursday, July 12, 2012 10:43:48 AM UTC-4, Shairon Toledo wrote:

> You should surround "query\_string" with "query", this way
> 
> curl -XGET '  
> [http://localhost:9200/albums/album/\_search?pretty=true&explain=true](http://localhost:9200/albums/album/_search?pretty=true&explain=true)' -d '  
> {  
> "query":{  
> "query\_string" : {  
> "fields" : ["artist", "album^5"],  
> "query" : "adele 21",  
> "use\_dis\_max" : true  
> }  
> }  
> }  
> '
> 
> On Thu, Jul 12, 2012 at 11:21 AM, Vinicius Carvalho \<  
> [viniciusccarvalho@gmail.com](mailto:viniciusccarvalho@gmail.com)\> wrote:
> 
> > Hi, I have an index with this configuration for analyzer:
> > 
> > {  
> > "albums" : {  
> > "settings" : {  
> > "index.analysis.analyzer.text\_en.filter.2" : "porterStem",  
> > "index.analysis.analyzer.text\_en.filter.1" : "lowercase",  
> > "index.analysis.analyzer.text\_en.filter.0" : "standard",  
> > "index.analysis.analyzer.text\_en.tokenizer" : "standard",  
> > "index.analysis.analyzer.text\_en.type" : "custom",  
> > "index.number\_of\_shards" : "1",  
> > "index.number\_of\_replicas" : "0",  
> > "index.version.created" : "190899"  
> > }  
> > }  
> > }
> > 
> > When I run this query:
> > 
> > curl -XGET '  
> > [http://localhost:9200/albums/album/\_search?pretty=true&explain=true](http://localhost:9200/albums/album/_search?pretty=true&explain=true)' -d '  
> > {  
> > "query\_string" : {  
> > "fields" : ["artist", "album^5"],  
> > "query" : "adele 21",  
> > "use\_dis\_max" : true  
> > }  
> > }  
> > '
> > 
> > I'm getting back an exception on No Parser for element:
> > 
> > [2012-07-12 10:16:58,056][DEBUG][action.search.type] [Snowfall]  
> > [albums][0], node[CooohIbFS7WDcvgkkgH\_jg], [P], s[STARTED]: Failed to  
> > execute [org.elasticsearch.action.search.SearchRequest@31ad557c]  
> > org.elasticsearch.search.SearchParseException: [albums][0]:  
> > from[-1],size[-1]: Parse Failure [Failed to parse source [  
> > {  
> > "query\_string" : {  
> > "fields" : ["artist", "album^5"],  
> > "query" : "adele 21",  
> > "use\_dis\_max" : true  
> > }  
> > }  
> > ]]  
> > at  
> > org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)  
> > at  
> > org.elasticsearch.search.SearchService.createContext(SearchService.java:469)  
> > at  
> > org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:301)  
> > at  
> > org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:242)  
> > at  
> > org.elasticsearch.action.search.type.TransportSearchQueryAndFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryAndFetchAction.java:75)  
> > at  
> > org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)  
> > at  
> > org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)  
> > at  
> > org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)  
> > Caused by: org.elasticsearch.search.SearchParseException: [albums][0]:  
> > from[-1],size[-1]: Parse Failure [No parser for element [query\_string]]  
> > at  
> > org.elasticsearch.search.SearchService.parseSource(SearchService.java:543)  
> > ... 10 more
> > 
> > Why is that? Is this an issue with snowball analyzer?
> > 
> > Regards
> 
> --
> 
> Shairon Toledo  
> [http://hashcode.me](http://hashcode.me)

---

<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:20am UTC](https://discuss.elastic.co/t/parse-failure-no-parser-for-element-query-string/8398/4 "2017-07-06T03:20:28Z")

</div>


