# What is wrong with the below Filtered Query?

**URL:** <https://discuss.elastic.co/t/what-is-wrong-with-the-below-filtered-query/20850>\
**Category:** Elasticsearch\
**Created:** [November 19, 2014, 10:51pm UTC](https://discuss.elastic.co/t/what-is-wrong-with-the-below-filtered-query/20850 "2014-11-19T22:51:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ap1](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Ap1](https://discuss.elastic.co/u/Ap1)\
**Post date:** [November 19, 2014, 10:51pm UTC](https://discuss.elastic.co/t/what-is-wrong-with-the-below-filtered-query/20850/1 "2014-11-19T22:51:47Z")

</div>

Using filter to 1st filter source = xyz and then score documents based on  
name = abc

curl -XGET 'http://:9200//\_search?pretty' -d '{  
"filtered" : {  
"query": { "term": { "name : "abc" }},  
"filter": { "terms" : { "source" : ["xyz"] }}  
}}'

--  
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/30432a9d-070d-43da-928b-682dea75eda6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/30432a9d-070d-43da-928b-682dea75eda6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [November 20, 2014, 5:50am UTC](https://discuss.elastic.co/t/what-is-wrong-with-the-below-filtered-query/20850/2 "2014-11-20T05:50:21Z")

</div>

Can you elaborate more on what you mean by "wrong"? Performance problem?  
Syntax error? (I do see a missing double quote at the end of "name").

On Wednesday, November 19, 2014 2:51:47 PM UTC-8, Ap wrote:

> Using filter to 1st filter source = xyz and then score documents based on  
> name = abc
> 
> curl -XGET 'http://:9200//\_search?pretty' -d '{  
> "filtered" : {  
> "query": { "term": { "name : "abc" }},  
> "filter": { "terms" : { "source" : ["xyz"] }}  
> }}'

--  
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/eaa726e2-9ad9-4fa0-a4ea-42887d9b5bbf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/eaa726e2-9ad9-4fa0-a4ea-42887d9b5bbf%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:48am UTC](https://discuss.elastic.co/t/what-is-wrong-with-the-below-filtered-query/20850/3 "2017-07-06T00:48:49Z")

</div>

Closed on July 6, 2017, 12:48am UTC


