# Example is not working

**URL:** https://discuss.elastic.co/t/example-is-not-working/108745
**Category:** Elasticsearch
**Created:** [November 22, 2017, 3:48pm UTC](https://discuss.elastic.co/t/example-is-not-working/108745 "2017-11-22T15:48:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![steveLuo](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@steveLuo](https://discuss.elastic.co/u/steveLuo)
#### Post date: [November 22, 2017, 3:48pm UTC](https://discuss.elastic.co/t/example-is-not-working/108745/1 "2017-11-22T15:48:43Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/guide/current/application-joins.html)

what am i missing?  
Thanks,  
Steve

---

<div class="post-metadata">

### Author: ![ParitoshBh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paritoshbh/32/22487_2.png) [@ParitoshBh](https://discuss.elastic.co/u/ParitoshBh)
#### Post date: [November 22, 2017, 4:17pm UTC](https://discuss.elastic.co/t/example-is-not-working/108745/2 "2017-11-22T16:17:44Z")

</div>

Looks like the documentation is bit outdated,

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

```auto
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.

---

<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: [November 22, 2017, 4:20pm UTC](https://discuss.elastic.co/t/example-is-not-working/108745/3 "2017-11-22T16:20:09Z")

</div>

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

---

<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: [December 20, 2017, 4:20pm UTC](https://discuss.elastic.co/t/example-is-not-working/108745/4 "2017-12-20T16:20:27Z")

</div>

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