SearchPhaseExecutionException[Failed to execute phase [query], all shards failed

Hello

For test purpose I'm using elasticasearch 0.90.7 on windows
I followed the 5 minutes tutorials described here:

http://www.elasticsearchtutorial.com/elasticsearch-in-5-minutes.html

I successfully created two nodes by launching ealsticasearch twice.

This way I get

http://localhost:9200/

{
"ok" : true,
"status" : 200,
"name" : "Osborn, Harry",
"version" : {
"number" : "0.90.7",
"build_hash" : "36897d07dadcb70886db7f149e645ed3d44eb5f2",
"build_timestamp" : "2013-11-13T12:06:54Z",
"build_snapshot" : false,
"lucene_version" : "4.5.1"
},
"tagline" : "You Know, for Search"
}

and on
http://localhost:9201/ http://localhost:9200/
{

"ok" : true,
"status" : 200,
"name" : "Ms. Steed",
"version" : {
"number" : "0.90.7",
"build_hash" : "36897d07dadcb70886db7f149e645ed3d44eb5f2",
"build_timestamp" : "2013-11-13T12:06:54Z",
"build_snapshot" : false,
"lucene_version" : "4.5.1"
},
"tagline" : "You Know, for Search"
}

And if i try:
$ curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'

{
"cluster_name" : "elasticsearch",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 2,
"active_primary_shards" : 10,
"active_shards" : 20,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}

So everything seems all right...
I can do a basic "match" search:
GET _search
{
"query": {
"match_all": {}
}
}

and so i get:
{
"took": 64,
"timed_out": false,
"_shards": {
"total": 10,
"successful": 10,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 1,
"hits": [
{
"_index": "blog",
"_type": "post",
"_id": "3",
"_score": 1,
"_source": {
"user": "dilbert",
"postDate": "2011-12-10",
"body": "Lorem ipsum dolor sit amet, consectetuer adipiscing
elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
aliquam erat volutpat",
"title": "Lorem ipsum"
}
},
{
"_index": "blog",
"_type": "user",
"_id": "dilbert",
"_score": 1,
"_source": {
"name": "Dilbert Brown"
}
},
{
"_index": "blog",
"_type": "post",
"_id": "1",
"_score": 1,
"_source": {
"user": "dilbert",
"postDate": "2011-12-15",
"body": "Search is hard. Search should be easy.",
"title": "On search"
}
},
{
"_index": "blog",
"_type": "post",
"_id": "2",
"_score": 1,
"_source": {
"user": "dilbert",
"postDate": "2011-12-12",
"body": "Distribution is hard. Distribution should be easy.",
"title": "On distributed search"
}
}
]
}
}

But...

If I try to make a simple json search with the "sense" chrome extension :
GET _search
{

"field" : { "body" : "lorem" }   

}

I get this:

{
"error": "SearchPhaseExecutionException[Failed to execute phase [query],
all shards failed; shardFailures {[7jOr3GUvQACEf-pwRU2PCQ][blog][4]:
SearchParseException[[blog][4]: from[-1],size[-1]: Parse Failure [Failed to
parse source [{\n \n "field" : { "body" : "lorem" } \n
\n}\n]]]; nested: SearchParseException[[blog][4]: from[-1],size[-1]: Parse
Failure [No parser for element [field]]];
}{[7jOr3GUvQACEf-pwRU2PCQ][index][4]: SearchParseException[[index][4]:
from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n
"field" : { "body" : "lorem" } \n \n}\n]]]; nested:
SearchParseException[[index][4]: from[-1],size[-1]: Parse Failure [No
parser for element [field]]]; }{[RuvN-fRjRui-LZhHeaddKg][index][2]:
RemoteTransportException[[Ms.
Steed][inet[/172.16.17.18:9301]][search/phase/query]]; nested:
SearchParseException[[index][2]: from[-1],size[-1]: Parse Failure [Failed
to parse source [{\n \n "field" : { "body" : "lorem" } \n
\n}\n]]]; nested: SearchParseException[[index][2]: from[-1],size[-1]: Parse
Failure [No parser for element [field]]];
}{[7jOr3GUvQACEf-pwRU2PCQ][blog][2]: SearchParseException[[blog][2]:
from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n
"field" : { "body" : "lorem" } \n \n}\n]]]; nested:
SearchParseException[[blog][2]: from[-1],size[-1]: Parse Failure [No parser
for element [field]]]; }{[7jOr3GUvQACEf-pwRU2PCQ][index][3]:
SearchParseException[[index][3]: from[-1],size[-1]: Parse Failure [Failed
to parse source [{\n \n "field" : { "body" : "lorem" } \n
\n}\n]]]; nested: SearchParseException[[index][3]: from[-1],size[-1]: Parse
Failure [No parser for element [field]]];
}{[7jOr3GUvQACEf-pwRU2PCQ][blog][3]: SearchParseException[[blog][3]:
from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n
"field" : { "body" : "lorem" } \n \n}\n]]]; nested:
SearchParseException[[blog][3]: from[-1],size[-1]: Parse Failure [No parser
for element [field]]]; }{[RuvN-fRjRui-LZhHeaddKg][index][1]:
RemoteTransportException[[Ms.
Steed][inet[/172.16.17.18:9301]][search/phase/query]]; nested:
SearchParseException[[index][1]: from[-1],size[-1]: Parse Failure [Failed
to parse source [{\n \n "field" : { "body" : "lorem" } \n
\n}\n]]]; nested: SearchParseException[[index][1]: from[-1],size[-1]: Parse
Failure [No parser for element [field]]];
}{[7jOr3GUvQACEf-pwRU2PCQ][index][0]: SearchParseException[[index][0]:
from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n
"field" : { "body" : "lorem" } \n \n}\n]]]; nested:
SearchParseException[[index][0]: from[-1],size[-1]: Parse Failure [No
parser for element [field]]]; }{[7jOr3GUvQACEf-pwRU2PCQ][blog][1]:
SearchParseException[[blog][1]: from[-1],size[-1]: Parse Failure [Failed to
parse source [{\n \n "field" : { "body" : "lorem" } \n
\n}\n]]]; nested: SearchParseException[[blog][1]: from[-1],size[-1]: Parse
Failure [No parser for element [field]]];
}{[RuvN-fRjRui-LZhHeaddKg][blog][0]: RemoteTransportException[[Ms.
Steed][inet[/172.16.17.18:9301]][search/phase/query]]; nested:
SearchParseException[[blog][0]: from[-1],size[-1]: Parse Failure [Failed to
parse source [{\n \n "field" : { "body" : "lorem" } \n
\n}\n]]]; nested: SearchParseException[[blog][0]: from[-1],size[-1]: Parse
Failure [No parser for element [field]]]; }]",
"status": 400
}

Any ideas why I get this error?

Thx by advance !

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a63aebd7-d338-4f5a-aaa9-ffbc6083e30c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey Florent,

Your query needs to be wrapped inside query field. Something like:

GET _search
{
"query": {

"field" : { "body" : "lorem" }   

}
}

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 16 décembre 2013 at 13:52:30, Florent Arcambal (florent.arcambal@gmail.com) a écrit:

Hello

For test purpose I'm using elasticasearch 0.90.7 on windows
I followed the 5 minutes tutorials described here:

http://www.elasticsearchtutorial.com/elasticsearch-in-5-minutes.html

I successfully created two nodes by launching ealsticasearch twice.

This way I get

http://localhost:9200/

{
"ok" : true,
"status" : 200,
"name" : "Osborn, Harry",
"version" : {
"number" : "0.90.7",
"build_hash" : "36897d07dadcb70886db7f149e645ed3d44eb5f2",
"build_timestamp" : "2013-11-13T12:06:54Z",
"build_snapshot" : false,
"lucene_version" : "4.5.1"
},
"tagline" : "You Know, for Search"
}

and on
http://localhost:9201/

{

"ok" : true,
"status" : 200,
"name" : "Ms. Steed",
"version" : {
"number" : "0.90.7",
"build_hash" : "36897d07dadcb70886db7f149e645ed3d44eb5f2",
"build_timestamp" : "2013-11-13T12:06:54Z",
"build_snapshot" : false,
"lucene_version" : "4.5.1"
},
"tagline" : "You Know, for Search"
}

And if i try:
$ curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'

{
"cluster_name" : "elasticsearch",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 2,
"active_primary_shards" : 10,
"active_shards" : 20,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}

So everything seems all right...
I can do a basic "match" search:
GET _search
{
"query": {
"match_all": {}
}
}

and so i get:
{
"took": 64,
"timed_out": false,
"_shards": {
"total": 10,
"successful": 10,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 1,
"hits": [
{
"_index": "blog",
"_type": "post",
"_id": "3",
"_score": 1,
"_source": {
"user": "dilbert",
"postDate": "2011-12-10",
"body": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat",
"title": "Lorem ipsum"
}
},
{
"_index": "blog",
"_type": "user",
"_id": "dilbert",
"_score": 1,
"_source": {
"name": "Dilbert Brown"
}
},
{
"_index": "blog",
"_type": "post",
"_id": "1",
"_score": 1,
"_source": {
"user": "dilbert",
"postDate": "2011-12-15",
"body": "Search is hard. Search should be easy.",
"title": "On search"
}
},
{
"_index": "blog",
"_type": "post",
"_id": "2",
"_score": 1,
"_source": {
"user": "dilbert",
"postDate": "2011-12-12",
"body": "Distribution is hard. Distribution should be easy.",
"title": "On distributed search"
}
}
]
}
}

But...

If I try to make a simple json search with the "sense" chrome extension :
GET _search
{

"field" : { "body" : "lorem" }   

}

I get this:

{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[7jOr3GUvQACEf-pwRU2PCQ][blog][4]: SearchParseException[[blog][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[blog][4]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[7jOr3GUvQACEf-pwRU2PCQ][index][4]: SearchParseException[[index][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[index][4]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[RuvN-fRjRui-LZhHeaddKg][index][2]: RemoteTransportException[[Ms. Steed][inet[/172.16.17.18:9301]][search/phase/query]]; nested: SearchParseException[[index][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[index][2]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[7jOr3GUvQACEf-pwRU2PCQ][blog][2]: SearchParseException[[blog][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[blog][2]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[7jOr3GUvQACEf-pwRU2PCQ][index][3]: SearchParseException[[index][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[index][3]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[7jOr3GUvQACEf-pwRU2PCQ][blog][3]: SearchParseException[[blog][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[blog][3]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[RuvN-fRjRui-LZhHeaddKg][index][1]: RemoteTransportException[[Ms. Steed][inet[/172.16.17.18:9301]][search/phase/query]]; nested: SearchParseException[[index][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[index][1]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[7jOr3GUvQACEf-pwRU2PCQ][index][0]: SearchParseException[[index][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[index][0]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[7jOr3GUvQACEf-pwRU2PCQ][blog][1]: SearchParseException[[blog][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[blog][1]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }{[RuvN-fRjRui-LZhHeaddKg][blog][0]: RemoteTransportException[[Ms. Steed][inet[/172.16.17.18:9301]][search/phase/query]]; nested: SearchParseException[[blog][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \n "field" : { "body" : "lorem" } \n \n}\n]]]; nested: SearchParseException[[blog][0]: from[-1],size[-1]: Parse Failure [No parser for element [field]]]; }]",
"status": 400
}

Any ideas why I get this error?

Thx by advance !

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a63aebd7-d338-4f5a-aaa9-ffbc6083e30c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/etPan.52aefe20.3f2dba31.6956%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/groups/opt_out.