# Terms filter on analyzed field

**URL:** <https://discuss.elastic.co/t/terms-filter-on-analyzed-field/36228>\
**Category:** Elasticsearch\
**Created:** [December 2, 2015, 10:53pm UTC](https://discuss.elastic.co/t/terms-filter-on-analyzed-field/36228 "2015-12-02T22:53:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lifo888](https://avatars.discourse-cdn.com/v4/letter/l/6a8cbe/32.png) [@lifo888](https://discuss.elastic.co/u/lifo888)\
**Post date:** [December 2, 2015, 10:53pm UTC](https://discuss.elastic.co/t/terms-filter-on-analyzed-field/36228/1 "2015-12-02T22:53:55Z")

</div>

Hi,

I'm trying to under how terms filter works with analyzed fields. I have a language field that uses a custom analyzer that coverts the text to lowercase and tokenize the string based on comma. So when indexing doc with language=EN,KO,ZH, i see that ES generates en, ko and zh as the token, and i confirmed that using the \_analyze API.

analyze API result:  
{  
"tokens" : [ {  
"token" : "en",  
"start\_offset" : 0,  
"end\_offset" : 2,  
"type" : "",  
"position" : 1  
}, {  
"token" : "ko",  
"start\_offset" : 3,  
"end\_offset" : 5,  
"type" : "",  
"position" : 2  
}, {  
"token" : "zh",  
"start\_offset" : 6,  
"end\_offset" : 8,  
"type" : "",  
"position" : 3  
} ]  
}

... But when i use terms filters to search on the field i get the doc back when i search on "zh", but no result when i search for "ko" or "en". I know terms filters are not analyze but i'm enter the exact token string, so why wouldn't ko or en match?

---

<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 5, 2017, 11:34pm UTC](https://discuss.elastic.co/t/terms-filter-on-analyzed-field/36228/2 "2017-07-05T23:34:04Z")

</div>


