Question for tokenizer and synonym

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2891dc4d-9826-4d83-a1e0-aeeae73f47c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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) 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2891dc4d-9826-4d83-a1e0-aeeae73f47c4%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/etPan.5513c5e1.2eb141f2.166%40citra-2.local.
For more options, visit https://groups.google.com/d/optout.