# Problem about index\_analyzer and search\_analyzer

**URL:** https://discuss.elastic.co/t/problem-about-index-analyzer-and-search-analyzer/6021
**Category:** Elasticsearch
**Created:** [November 30, 2011, 10:07am UTC](https://discuss.elastic.co/t/problem-about-index-analyzer-and-search-analyzer/6021 "2011-11-30T10:07:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)
#### Post date: [November 30, 2011, 10:07am UTC](https://discuss.elastic.co/t/problem-about-index-analyzer-and-search-analyzer/6021/1 "2011-11-30T10:07:51Z")

</div>

I have my analyzers defined in config/elasticsearch.json as below  
##########################################################################################  
"analysis" : {  
"analyzer" : {  
"nGramAnalyzer":{  
"type":"custom",  
"tokenizer":"standard",  
"filter":  
["standard","lowercase","englishSnowball","nGramFilter"]  
},  
"standardAnalyzer":{  
"type":"custom",  
"tokenizer":"standard",  
"filter":  
["standard","lowercase","englishSnowball"]  
}  
},  
"filter":{  
"nGramFilter":{  
"type":"nGram",  
"min\_gram":1,  
"max\_gram":64  
},  
"edgeNGramFilter":{  
"type":"edgeNGram",  
"min\_gram":1,  
"max\_gram":64,  
"side":"front"  
},  
"englishSnowball":{  
"type":"snowball",  
"language":"English"  
}  
}

and for one of may mapping json config, I have a field phone is  
configured like this  
"phone":{  
"type" : "string",  
"index": "analyzed",  
"index\_analyzer":"nGramAnalyzer",  
"search\_analyzer":"standardAnalyzer",  
"store":"yes",  
"term\_vector":"with\_positions\_offsets"  
}

through elasticsearch-head, i can see the configuration have taken  
effect, however, when i search phone field with query\_string, the  
highlight is not as expected, for example  
i have a phone field for indexing with value 15103605354, i search  
with query 1510, the highlight is expected as this:  
_1510_3605354, however, the actual result is this: _1\</  
em\>5103605354_

could anyone give me an explanation for this problem?

---

<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, 3:46am UTC](https://discuss.elastic.co/t/problem-about-index-analyzer-and-search-analyzer/6021/2 "2017-07-06T03:46:57Z")

</div>


