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

**URL:** <https://discuss.elastic.co/t/searchphaseexecutionexception-failed-to-execute-phase-query-all-shards-failed/14886>\
**Category:** Elasticsearch\
**Created:** [December 16, 2013, 12:52pm UTC](https://discuss.elastic.co/t/searchphaseexecutionexception-failed-to-execute-phase-query-all-shards-failed/14886 "2013-12-16T12:52:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florent\_Arcambal](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@Florent\_Arcambal](https://discuss.elastic.co/u/Florent_Arcambal)\
**Post date:** [December 16, 2013, 12:52pm UTC](https://discuss.elastic.co/t/searchphaseexecutionexception-failed-to-execute-phase-query-all-shards-failed/14886/1 "2013-12-16T12:52:27Z")

</div>

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](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/](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:9201/) [http://localhost:9200/](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](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](mailto: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](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](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 16, 2013, 1:20pm UTC](https://discuss.elastic.co/t/searchphaseexecutionexception-failed-to-execute-phase-query-all-shards-failed/14886/2 "2013-12-16T13:20:32Z")

</div>

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](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 16 décembre 2013 at 13:52:30, Florent Arcambal ([florent.arcambal@gmail.com](mailto: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](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/](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: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](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](mailto: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](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](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](mailto: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](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](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:01am UTC](https://discuss.elastic.co/t/searchphaseexecutionexception-failed-to-execute-phase-query-all-shards-failed/14886/3 "2017-07-06T02:01:00Z")

</div>


