# Does ES support to use the analyzer which decided by \_analyzer field in search?

**URL:** <https://discuss.elastic.co/t/does-es-support-to-use-the-analyzer-which-decided-by--analyzer-field-in-search/16488>\
**Category:** Elasticsearch\
**Created:** [March 20, 2014, 8:10am UTC](https://discuss.elastic.co/t/does-es-support-to-use-the-analyzer-which-decided-by--analyzer-field-in-search/16488 "2014-03-20T08:10:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [March 20, 2014, 8:10am UTC](https://discuss.elastic.co/t/does-es-support-to-use-the-analyzer-which-decided-by--analyzer-field-in-search/16488/1 "2014-03-20T08:10:59Z")

</div>

Hi all,

Assume my schema is

{

> "settings": {  
> "index": {  
> "analysis": {  
> "analyzer": {  
> "ik\_analyzer": {  
> "tokenizer": "ik",  
> "filter": ["engram"]  
> }  
> },  
> "filter": {  
> "engram": {  
> "type": "edgeNGram",  
> "min\_gram": 2,  
> "max\_gram": 10  
> }  
> }  
> }  
> }  
> },  
> "mappings": {  
> "main": {  
> "\_analyzer": {  
> "path": "analyzer\_name"  
> },  
> "properties": {  
> "id": { "type": "string", "index": "analyzed"},  
> "id2": { "type": "string", "index": "analyzed", "analyzer": "ik\_analyzer"},  
> "analyzer\_name": { "type": "string", "index": "not\_analyzed"}
> 
> }  
> }  
> }  
> }

I use the "\_analyzer" to use different analyzer which is decided by the  
"analyzer\_name" field between documents.

When I use the "match query" during search for the "id" field, whose  
analyzer is decided by the field of "analyzer\_name", what's the search  
analyzer to be used in this situation without explicitly specifying the  
search analyzer?  
And how to use the analyzer decided by the "analyzer\_name" field to be the  
search analyzer?

We know if I queried for the "id2" field, the search analyzer is decided by  
the analyzer it used, that is "ik\_analyzer".  
But does ES support the functionality, using the same analyzer to search  
with the analyzer at indexing, after setting the "\_analyzer" ?

Ideas?

cheers,

Ivan

--  
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/b20e70e1-33e1-43d3-888d-17119d49121f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b20e70e1-33e1-43d3-888d-17119d49121f%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, 1:41am UTC](https://discuss.elastic.co/t/does-es-support-to-use-the-analyzer-which-decided-by--analyzer-field-in-search/16488/2 "2017-07-06T01:41:58Z")

</div>


