# Question for tokenizer and synonym

**URL:** <https://discuss.elastic.co/t/question-for-tokenizer-and-synonym/22876>\
**Category:** Elasticsearch\
**Created:** [March 24, 2015, 9:41pm UTC](https://discuss.elastic.co/t/question-for-tokenizer-and-synonym/22876 "2015-03-24T21:41:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prateek](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@prateek](https://discuss.elastic.co/u/prateek)\
**Post date:** [March 24, 2015, 9:41pm UTC](https://discuss.elastic.co/t/question-for-tokenizer-and-synonym/22876/1 "2015-03-24T21:41:04Z")

</div>

I am having requirement similar to below:

- search for "chevy" should map to search for "chevrolet". I am using  
synonyms to accomplish this.
- search for "BMW 6 series" should map to "61i", "62i", "63i" and so on.  
I am planning to use synonyms to accomplish this too.

Field that contains either (chevrolet or 61i or 62i or 63i) is having  
index analyzer as:

"synonym\_analyzer" : {  
"type": "custom",  
"tokenizer": "standard",  
"filter": ["lowercase", "synonym\_filter"]  
}

My issue with above standard tokenizer is that I cannot map "BMW 6 series" to "61i", "62i", "63i". I cannot use "keyword" tokenizer as the search could be: "chevy red" or "BMW 6 series v8".  
I am open to changing tokenizers and other elements if required. Please advise.

Thanks,  
Prateek

--  
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/2891dc4d-9826-4d83-a1e0-aeeae73f47c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2891dc4d-9826-4d83-a1e0-aeeae73f47c4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![masaru](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@masaru](https://discuss.elastic.co/u/masaru)\
**Post date:** [March 26, 2015, 8:39am UTC](https://discuss.elastic.co/t/question-for-tokenizer-and-synonym/22876/2 "2015-03-26T08:39:01Z")

</div>

Hi,

I guess you are using query string query. If you use match query instead, it _should_ work.

Masaru

On March 25, 2015 at 06:41:11, Prateek Asthana ([paryanz@gmail.com](mailto:paryanz@gmail.com)) wrote:

I am having requirement similar to below:  
search for "chevy" should map to search for "chevrolet". I am using synonyms to accomplish this.  
search for "BMW 6 series" should map to "61i", "62i", "63i" and so on. I am planning to use synonyms to accomplish this too.  
Field that contains either (chevrolet or 61i or 62i or 63i) is having index analyzer as:

"synonym\_analyzer" : {  
"type": "custom",  
"tokenizer": "standard",  
"filter": ["lowercase", "synonym\_filter"]  
}

My issue with above standard tokenizer is that I cannot map "BMW 6 series" to "61i", "62i", "63i". I cannot use "keyword" tokenizer as the search could be: "chevy red" or "BMW 6 series v8".  
I am open to changing tokenizers and other elements if required. Please advise.

Thanks,  
Prateek

--  
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/2891dc4d-9826-4d83-a1e0-aeeae73f47c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2891dc4d-9826-4d83-a1e0-aeeae73f47c4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/etPan.5513c5e1.2eb141f2.166%40citra-2.local](https://groups.google.com/d/msgid/elasticsearch/etPan.5513c5e1.2eb141f2.166%40citra-2.local).  
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, 12:23am UTC](https://discuss.elastic.co/t/question-for-tokenizer-and-synonym/22876/3 "2017-07-06T00:23:47Z")

</div>


