# Es 5.1.1 \[match\_all\] query malformed, no start\_object after query name

**URL:** <https://discuss.elastic.co/t/es-5-1-1-match-all-query-malformed-no-start-object-after-query-name/68827>\
**Category:** Elasticsearch\
**Created:** [December 13, 2016, 8:20am UTC](https://discuss.elastic.co/t/es-5-1-1-match-all-query-malformed-no-start-object-after-query-name/68827 "2016-12-13T08:20:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorcom](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@lorcom](https://discuss.elastic.co/u/lorcom)\
**Post date:** [December 13, 2016, 8:20am UTC](https://discuss.elastic.co/t/es-5-1-1-match-all-query-malformed-no-start-object-after-query-name/68827/1 "2016-12-13T08:20:09Z")

</div>

Hi to everybody,

I'm trying to convert a query, written for Elasticsearch 2, to Elasticsearch 5.1.1.

Es 2

```
 {
    	"index": "wsx5_answers",
    	"type": "topics",
    	"body": {
    		"fields": ["title"],
    		"query": {
    			"filtered": {
    				"query": {
    					"match_all": []
    				},
    				"filter": {
    					"bool": {
    						"must": [{
    							"terms": {
    								"status": ["approved"]
    							}
    						}, {
    							"terms": {
    								"type": ["question", "idea", "praise", "update", "info", "bug", "faq", "tipsandtricks"]
    							}
    						}, {
    							"term": {
    								"author": 12345
    							}
    						}, {
    							"bool": {
    								"should": [{
    									"term": {
    										"public": true
    									}
    								}, {
    									"term": {
    										"author": 12345
    									}
    								}]
    							}
    						}, {
    							"terms": {
    								"lang": ["it"]
    							}
    						}]
    					}
    				}
    			}
    		},
    		"size": 15,
    		"from": 0,
    		"sort": {
    			"lastupdate": {
    				"order": "desc"
    			}
    		}
    	}
    }

```

Es 5.1.1

```
{
	"index": "wsx5_answers",
	"type": "topics",
	"body": {
		"stored_fields": ["title"],
		"query": {
			"bool": {
				"must": {
					"match_all": []
				},
				"filter": {
					"bool": {
						"must": [{
							"terms": {
								"status": ["approved"]
							}
						}, {
							"terms": {
								"type": ["question", "idea", "praise", "update", "info", "bug", "faq", "tipsandtricks"]
							}
						}, {
							"term": {
								"author": 12345
							}
						}, {
							"bool": {
								"should": [{
									"term": {
										"public": true
									}
								}, {
									"term": {
										"author": 12345
									}
								}]
							}
						}, {
							"terms": {
								"lang": ["it"]
							}
						}]
					}
				}
			}
		},
		"size": 15,
		"from": 0,
		"sort": {
			"lastupdate": {
				"order": "desc"
			}
		}
	}
}

```

Always rise this exception:

> [match\_all] query malformed, no start\_object after query name

I tried to remove "bool" under "filter", but nothing change.

I use ElastSearch PHP Client.

Someone can help me?

---

<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 13, 2016, 8:57am UTC](https://discuss.elastic.co/t/es-5-1-1-match-all-query-malformed-no-start-object-after-query-name/68827/2 "2016-12-13T08:57:06Z")

</div>

`"match_all": []` should be `"match_all": {}`

---

<div class="post-metadata">

**Author:** ![lorcom](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@lorcom](https://discuss.elastic.co/u/lorcom)\
**Post date:** [December 13, 2016, 9:32am UTC](https://discuss.elastic.co/t/es-5-1-1-match-all-query-malformed-no-start-object-after-query-name/68827/3 "2016-12-13T09:32:06Z")

</div>

Thank you very much!

---

<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:** [January 10, 2017, 9:32am UTC](https://discuss.elastic.co/t/es-5-1-1-match-all-query-malformed-no-start-object-after-query-name/68827/4 "2017-01-10T09:32:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
