Example is not working

I got the error

{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "no [query] registered for [filtered]",
"line": 3,
"col": 17
}
],
"type": "parsing_exception",
"reason": "no [query] registered for [filtered]",
"line": 3,
"col": 17
},
"status": 400
}

when I ran the example
GET /my_index/blogpost/_search
{
"query": {
"filtered": {
"filter": {
"term": { "user": 1 }
}
}
}
}

from
https://www.elastic.co/guide/en/elasticsearch/guide/current/application-joins.html

what am i missing?
Thanks,
Steve

Looks like the documentation is bit outdated,

I got the same error as you did, but the following query works,

curl -XGET 'localhost:9200/my_index/blogpost/_search?pretty' -H 'Content-Type: application/json' -d'
{
    "query": {
		"bool": {
			"filter": {
				"term": {
					"user": 1
				}
			}			
		}
	}
}
'

Basically wrapped the filter query in bool query.

The user guide has not been updated to 5.x and 6.x yet.
The reference guide is up to date.

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