Parse Failure [No parser for element [query_string]]

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' -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

You should surround "query_string" with "query", this way

curl -XGET '
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> 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' -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

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' -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> 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' -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