In the exception raised it says: No parser for element [query_string] which
means elasticsearch don't recognize "query_string" as the root of JSON. In
this case you must start with "query". Look:
curl -XPOST "http://localhost:9200/users/_search" -d'
{
"query": {
"query_string": {
"default_field": "title",
"query": "this AND that OR thus"
}
}
}'
That doesn't work either. I am trying to execute this command from here:
On Thu, Apr 3, 2014 at 11:33 AM, Luiz Guilherme Pais dos Santos < luizgpsantos@gmail.com> wrote:
Hi Mohit,
In the exception raised it says: No parser for element [query_string]
which means elasticsearch don't recognize "query_string" as the root of
JSON. In this case you must start with "query". Look:
curl -XPOST "http://localhost:9200/users/_search" -d'
{
"query": {
"query_string": {
"default_field": "title",
"query": "this AND that OR thus"
}
}
}'
What happened when you executed the command, an exception? Which? No
results? Is there any documents indexed in elasticsearch? Please be more
clear about the problem.
On Thu, Apr 3, 2014 at 11:33 AM, Luiz Guilherme Pais dos Santos < luizgpsantos@gmail.com> wrote:
Hi Mohit,
In the exception raised it says: No parser for element [query_string]
which means elasticsearch don't recognize "query_string" as the root of
JSON. In this case you must start with "query". Look:
curl -XPOST "http://localhost:9200/users/_search" -d'
{
"query": {
"query_string": {
"default_field": "title",
"query": "this AND that OR thus"
}
}
}'
{"error":"SearchPhaseExecutionException[Failed to execute phase [query],
all shards failed; shardFailures {[LrIIW8-MTr6-qoWXk-Xl6A][users][2]:
RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]];
nested: SearchParseException[[users][2]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@15b0b65c; line: 3, column: 0])\n at [Source:
UNKNOWN; line: 18, column: 202]]; }{[Eybinjt4Sl21p1AujiwiaA][users][3]:
RemoteTransportException[[10.80.140.58][inet[/10.80.140.58:9300]][search/phase/query]];
nested: SearchParseException[[users][3]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@75d811e7; line: 3, column: 0])\n at [Source:
UNKNOWN; line: 18, column: 202]]; }{[LrIIW8-MTr6-qoWXk-Xl6A][users][0]:
RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]];
nested: SearchParseException[[users][0]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@443ab608; line: 3, column: 0])\n at [Source:
UNKNOWN; line: 18, column: 202]]; }{[LrIIW8-MTr6-qoWXk-Xl6A][users][1]:
RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]];
nested: SearchParseException[[users][1]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@749bddb5; line: 3, column: 0])\n at [Source:
UNKNOWN; line: 18, column: 202]]; }{[5ay80g1HTAinyRZBzEZHTg][users][4]:
SearchParseException[[users][4]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@65dc3111; line: 3, column: 0])\n at [Source:
[B@65dc3111; line: 18, column: 151]];
}]","status":400}[ec2-user@ip-10-80-140-13 ~]$
[ec2-user@ip-10-80-140-13 ~]$ Connection to 10.80.140.13 closed by remote
host.
Connection to 10.80.140.13 closed.
On Thu, Apr 3, 2014 at 11:43 AM, Luiz Guilherme Pais dos Santos < luizgpsantos@gmail.com> wrote:
What happened when you executed the command, an exception? Which? No
results? Is there any documents indexed in elasticsearch? Please be more
clear about the problem.
On Thu, Apr 3, 2014 at 11:33 AM, Luiz Guilherme Pais dos Santos < luizgpsantos@gmail.com> wrote:
Hi Mohit,
In the exception raised it says: No parser for element [query_string]
which means elasticsearch don't recognize "query_string" as the root of
JSON. In this case you must start with "query". Look:
curl -XPOST "http://localhost:9200/users/_search" -d'
{
"query": {
"query_string": {
"default_field": "title",
"query": "this AND that OR thus"
}
}
}'
{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[LrIIW8-MTr6-qoWXk-Xl6A][users][2]: RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]]; nested: SearchParseException[[users][2]: query[+title:this +title:that title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source [\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field": "title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]]; nested: JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@15b0b65c; line: 3, column: 0])\n at [Source: UNKNOWN; line: 18, column: 202]]; }{[Eybinjt4Sl21p1AujiwiaA][users][3]: RemoteTransportException[[10.80.140.58][inet[/10.80.140.58:9300]][search/phase/query]]; nested: SearchParseException[[users][3]: query[+title:this +title:that title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source [\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field": "title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]]; nested: JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@75d811e7; line: 3, column: 0])\n at [Source: UNKNOWN; line: 18, column: 202]]; }{[LrIIW8-MTr6-qoWXk-Xl6A][users][0]: RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]]; nested: SearchParseException[[users][0]: query[+title:this +title:that title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source [\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field": "title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]]; nested: JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@443ab608; line: 3, column: 0])\n at [Source: UNKNOWN; line: 18, column: 202]]; }{[LrIIW8-MTr6-qoWXk-Xl6A][users][1]: RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]]; nested: SearchParseException[[users][1]: query[+title:this +title:that title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source [\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field": "title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]]; nested: JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@749bddb5; line: 3, column: 0])\n at [Source: UNKNOWN; line: 18, column: 202]]; }{[5ay80g1HTAinyRZBzEZHTg][users][4]: SearchParseException[[users][4]: query[+title:this +title:that title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source [\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field": "title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]]; nested: JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@65dc3111; line: 3, column: 0])\n at [Source: [B@65dc3111; line: 18, column: 151]]; }]","status":400}[ec2-user@ip-10-80-140-13 ~]$
[ec2-user@ip-10-80-140-13 ~]$ Connection to 10.80.140.13 closed by remote host.
Connection to 10.80.140.13 closed.
On Thu, Apr 3, 2014 at 11:43 AM, Luiz Guilherme Pais dos Santos luizgpsantos@gmail.com wrote:
What happened when you executed the command, an exception? Which? No results? Is there any documents indexed in elasticsearch? Please be more clear about the problem.
On Thu, Apr 3, 2014 at 3:37 PM, Mohit Anchlia mohitanchlia@gmail.com wrote:
That doesn't work either. I am trying to execute this command from here:
On Thu, Apr 3, 2014 at 11:33 AM, Luiz Guilherme Pais dos Santos luizgpsantos@gmail.com wrote:
Hi Mohit,
In the exception raised it says: No parser for element [query_string] which means elasticsearch don't recognize "query_string" as the root of JSON. In this case you must start with "query". Look:
curl -XPOST "http://localhost:9200/users/_search" -d'
{
"query": {
"query_string": {
"default_field": "title",
"query": "this AND that OR thus"
}
}
}'
Cheers,
Luiz Guilherme
On Thu, Apr 3, 2014 at 3:26 PM, Mohit Anchlia mohitanchlia@gmail.com wrote:
I am just trying to execute a simple query string and I am getting this error:
{"error":"SearchPhaseExecutionException[Failed to execute phase [query],
all shards failed; shardFailures {[LrIIW8-MTr6-qoWXk-Xl6A][users][2]:
RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]];
nested: SearchParseException[[users][2]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@15b0b65c; line: 3, column: 0])\n at [Source:
UNKNOWN; line: 18, column: 202]]; }{[Eybinjt4Sl21p1AujiwiaA][users][3]:
RemoteTransportException[[10.80.140.58][inet[/10.80.140.58:9300]][search/phase/query]];
nested: SearchParseException[[users][3]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@75d811e7; line: 3, column: 0])\n at [Source:
UNKNOWN; line: 18, column: 202]]; }{[LrIIW8-MTr6-qoWXk-Xl6A][users][0]:
RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]];
nested: SearchParseException[[users][0]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@443ab608; line: 3, column: 0])\n at [Source:
UNKNOWN; line: 18, column: 202]]; }{[LrIIW8-MTr6-qoWXk-Xl6A][users][1]:
RemoteTransportException[[10.80.140.14][inet[/10.80.140.14:9300]][search/phase/query]];
nested: SearchParseException[[users][1]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@749bddb5; line: 3, column: 0])\n at [Source:
UNKNOWN; line: 18, column: 202]]; }{[5ay80g1HTAinyRZBzEZHTg][users][4]:
SearchParseException[[users][4]: query[+title:this +title:that
title:thus],from[-1],size[-1]: Parse Failure [Failed to parse source
[\n\n{\n\n "query": {\n\n "query_string": {\n\n "default_field":
"title",\n\n\n "query": "this AND that OR thus"\n\n }\n\n }\n\n]]];
nested: JsonParseException[Unexpected end-of-input: expected close marker
for OBJECT (from [Source: [B@65dc3111; line: 3, column: 0])\n at [Source:
[B@65dc3111; line: 18, column: 151]];
}]","status":400}[ec2-user@ip-10-80-140-13 ~]$
[ec2-user@ip-10-80-140-13 ~]$ Connection to 10.80.140.13 closed by remote
host.
Connection to 10.80.140.13 closed.
On Thu, Apr 3, 2014 at 11:43 AM, Luiz Guilherme Pais dos Santos < luizgpsantos@gmail.com> wrote:
What happened when you executed the command, an exception? Which? No
results? Is there any documents indexed in elasticsearch? Please be more
clear about the problem.
On Thu, Apr 3, 2014 at 11:33 AM, Luiz Guilherme Pais dos Santos < luizgpsantos@gmail.com> wrote:
Hi Mohit,
In the exception raised it says: No parser for element [query_string]
which means elasticsearch don't recognize "query_string" as the root of
JSON. In this case you must start with "query". Look:
curl -XPOST "http://localhost:9200/users/_search" -d'
{
"query": {
"query_string": {
"default_field": "title",
"query": "this AND that OR thus"
}
}
}'
In the reference docs when referring to queries, the above structure is
omitted and implied. So in your case, you just take the query_string query
syntax from the docs and plug it in to the part in my above
example.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.