# How does the match\_phrase work for a field with different search\_analyzer/index\_analyzer?

**URL:** https://discuss.elastic.co/t/how-does-the-match-phrase-work-for-a-field-with-different-search-analyzer-index-analyzer/19388
**Category:** Elasticsearch
**Created:** [August 21, 2014, 10:43am UTC](https://discuss.elastic.co/t/how-does-the-match-phrase-work-for-a-field-with-different-search-analyzer-index-analyzer/19388 "2014-08-21T10:43:33Z")
**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: [August 21, 2014, 10:43am UTC](https://discuss.elastic.co/t/how-does-the-match-phrase-work-for-a-field-with-different-search-analyzer-index-analyzer/19388/1 "2014-08-21T10:43:33Z")

</div>

Hi, all

The problem is I have an document field whose search analyzer is  
"fielda\_search" and index analyzer is "fielda\_index".

I cannot use the exact term to find the document.

here is the gist to reproduce the situation:  
[https://gist.github.com/hxuanji/b94d9c3514d7b08005d2](https://gist.github.com/hxuanji/b94d9c3514d7b08005d2).

My example document is "{"name": "Canon PowerShot D500"}".

The two token set of the two analyzers are:

fielda\_indexCanon 1PowerShot 2Power 2Shot 3D500 4D 4500 5fielda\_searchCanon  
1PowerShot 2D500 3D 3500 4

Obviously, it's different. But the token of the search analyzer are all  
included in the index analyzer. why it cannot be found by match\_phrase?

If I change the search\_analzyer to be the same one of index\_analyzer, the  
match\_phrase can find the document.

So what is the problem? And what is the rule of match\_phrase? Does it need  
to match all the tokens to be exact same ?

BTW, I am using ES 1.0.1.

Any idea?

Thanks.

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/5759ed92-7ea2-46f5-b6ce-522e07d397c0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5759ed92-7ea2-46f5-b6ce-522e07d397c0%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:07am UTC](https://discuss.elastic.co/t/how-does-the-match-phrase-work-for-a-field-with-different-search-analyzer-index-analyzer/19388/2 "2017-07-06T01:07:12Z")

</div>


