# Elasticsearch analyzer working with \_search

**URL:** <https://discuss.elastic.co/t/elasticsearch-analyzer-working-with--search/28908>\
**Category:** Elasticsearch\
**Created:** [September 9, 2015, 7:53am UTC](https://discuss.elastic.co/t/elasticsearch-analyzer-working-with--search/28908 "2015-09-09T07:53:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krish0608](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krish0608/32/6797_2.png) [@krish0608](https://discuss.elastic.co/u/krish0608)\
**Post date:** [September 9, 2015, 7:53am UTC](https://discuss.elastic.co/t/elasticsearch-analyzer-working-with--search/28908/1 "2015-09-09T07:53:03Z")

</div>

I defined a standard analyzer & mapping that I was surprised not built-in.

PUT /\_template/mytemplate  
{  
"template": "kindex\*",  
"settings": {  
"analysis": {  
"analyzer": {  
"kanalyzer": {  
"type": "standard",  
"stopwords": "the"  
}}  
}},  
"mappings" : {  
"kindex" : {  
"properties" : {  
"message" : { "type" : "string","analyzer" : "kanalyzer"}  
}  
}  
}  
}

Then i put different values in my kindex/ktype

PUT /kindex/ktype/3  
{  
"message":"this is abc the work "  
}

PUT /kindex/ktype/2  
{  
"message":"this is xyz the work "  
}

when i am searching it with  
localhost:9200/kindex/ktype/\_search  
It give output as it is not by removing "the" word as written in my analyzer.

It looks like elasticsearch performs the search with the default analyzer, which doesn't make sense. Shouldn't it perform the search with each field's own default analyzer?  
please help me out.

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [September 10, 2015, 5:24pm UTC](https://discuss.elastic.co/t/elasticsearch-analyzer-working-with--search/28908/2 "2015-09-10T17:24:26Z")

</div>

Can you try and see what the output of the analyze api is when you use your custom analyzer? Don't forget to specify the index name so that your custom analyzer can be found.

---

<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:51pm UTC](https://discuss.elastic.co/t/elasticsearch-analyzer-working-with--search/28908/3 "2017-07-05T23:51:07Z")

</div>


