# Terms filter with values to match in uppercase is not possible?

**URL:** <https://discuss.elastic.co/t/terms-filter-with-values-to-match-in-uppercase-is-not-possible/20902>\
**Category:** Elasticsearch\
**Created:** [November 22, 2014, 10:30pm UTC](https://discuss.elastic.co/t/terms-filter-with-values-to-match-in-uppercase-is-not-possible/20902 "2014-11-22T22:30:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dashaus](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dashaus](https://discuss.elastic.co/u/dashaus)\
**Post date:** [November 22, 2014, 10:30pm UTC](https://discuss.elastic.co/t/terms-filter-with-values-to-match-in-uppercase-is-not-possible/20902/1 "2014-11-22T22:30:39Z")

</div>

Hi!,  
I have a document like this:  
{  
"type": "film",  
"countries": ["US", "ES"]  
}

And i insert it in elasticsearch, then i do the follow search:

GET \_search?search\_type=dfs\_query\_and\_fetch  
{  
"query": {  
"filtered": {  
"query": {  
"term": {"type": "film"}  
},  
"filter": {  
"query": {  
"terms": {  
"countries": [  
"US",  
"ES"  
]  
}  
}  
}  
}  
}  
}

But I get a result without the document...But if I change the "terms"  
filter to...

....  
"terms": {  
"countries": [  
"us",  
"es"  
]  
}  
....

Then I get a result with the document! So, this is a bug or is a desired  
behavior?

Thanks!

Cheers,  
Emilio

--  
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/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 22, 2014, 10:45pm UTC](https://discuss.elastic.co/t/terms-filter-with-values-to-match-in-uppercase-is-not-possible/20902/2 "2014-11-22T22:45:20Z")

</div>

You are using the standard analyzer which is using a lowercase filter.

Jörg

On Sat, Nov 22, 2014 at 11:30 PM, Emilio García-Pumarino Álvarez \<  
[emili.tfe@gmail.com](mailto:emili.tfe@gmail.com)\> wrote:

> Hi!,  
> I have a document like this:  
> {  
> "type": "film",  
> "countries": ["US", "ES"]  
> }
> 
> And i insert it in elasticsearch, then i do the follow search:
> 
> GET \_search?search\_type=dfs\_query\_and\_fetch  
> {  
> "query": {  
> "filtered": {  
> "query": {  
> "term": {"type": "film"}  
> },  
> "filter": {  
> "query": {  
> "terms": {  
> "countries": [  
> "US",  
> "ES"  
> ]  
> }  
> }  
> }  
> }  
> }  
> }
> 
> But I get a result without the document...But if I change the "terms"  
> filter to...
> 
> ....  
> "terms": {  
> "countries": [  
> "us",  
> "es"  
> ]  
> }  
> ....
> 
> Then I get a result with the document! So, this is a bug or is a desired  
> behavior?
> 
> Thanks!
> 
> Cheers,  
> Emilio
> 
> --  
> 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/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAKdsXoE9c0bSXL711hkKk-v6sNwrOWW-P0reQBC-KgRBdyO57g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoE9c0bSXL711hkKk-v6sNwrOWW-P0reQBC-KgRBdyO57g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dashaus](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dashaus](https://discuss.elastic.co/u/dashaus)\
**Post date:** [November 22, 2014, 10:56pm UTC](https://discuss.elastic.co/t/terms-filter-with-values-to-match-in-uppercase-is-not-possible/20902/3 "2014-11-22T22:56:46Z")

</div>

Thanks!

El sábado, 22 de noviembre de 2014 22:45:27 UTC, Jörg Prante escribió:

> You are using the standard analyzer which is using a lowercase filter.
> 
> Jörg
> 
> On Sat, Nov 22, 2014 at 11:30 PM, Emilio García-Pumarino Álvarez \<  
> [emil...@gmail.com](mailto:emil...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi!,  
> > I have a document like this:  
> > {  
> > "type": "film",  
> > "countries": ["US", "ES"]  
> > }
> > 
> > And i insert it in elasticsearch, then i do the follow search:
> > 
> > GET \_search?search\_type=dfs\_query\_and\_fetch  
> > {  
> > "query": {  
> > "filtered": {  
> > "query": {  
> > "term": {"type": "film"}  
> > },  
> > "filter": {  
> > "query": {  
> > "terms": {  
> > "countries": [  
> > "US",  
> > "ES"  
> > ]  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > But I get a result without the document...But if I change the "terms"  
> > filter to...
> > 
> > ....  
> > "terms": {  
> > "countries": [  
> > "us",  
> > "es"  
> > ]  
> > }  
> > ....
> > 
> > Then I get a result with the document! So, this is a bug or is a desired  
> > behavior?
> > 
> > Thanks!
> > 
> > Cheers,  
> > Emilio
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6f6dd695-5703-4d8a-a8a9-2b095bd8389a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/b333024a-e547-4a04-8859-c717703a7562%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b333024a-e547-4a04-8859-c717703a7562%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/terms-filter-with-values-to-match-in-uppercase-is-not-possible/20902/4 "2017-07-06T00:48:15Z")

</div>


