may be you should debug like this:

POST  /location-test-no-boost/vehicles?pretty&analyzer=mysynonym 
"2500 HD"

and it will return the analyze result. You can compare to:

POST  /location-test-no-boost/vehicles?pretty&analyzer=standard
"Silverado 2500HD"

So you may know witch place has problem. 


在 2015年5月28日星期四 UTC+8上午11:20:51,Siva Shanmuga Subramanian Murugan写道:
>
> I have documents indexed in elastic cluster with the below mapping. 
> basically i have a field named model which holds car model names like 
> "Silverado 2500HD", "Silverado 1500HD" "LX 350" etc etc.
>
> POST /location-test-no-boost {
>     "settings":{
>         "analysis":{
>             "analyzer":{
>                 "mysynonym":{
>                     "tokenizer":"standard",
>                     "filter":[
>                         "standard","lowercase","stop","mysynonym"
>                     ],
>                     "ignore_case":true
>                 }
>             },
>             "filter":{
>                 "mysynonym":{
>                     "type":"synonym",
>                     "synonyms": [
>                             "2500 HD=>2500HD",
>                             "chevy silverado=>Silverado"
>                         ]
>                 }
>             }
>         }
>     },
>     "mappings":{
>         "vehicles":{
>             "properties":{
>                 "id":{
>                     "type":"long",
>                     "ignore_malformed":true
>                 },
>                 "model":{
>                     "type":"String",
>                     "index_analyzer": "standard",
>                     "search_analyzer":"mysynonym"
>                 }
>             }
>         }
>     }
> }
>
> The sample document content is
>
> POST /location-test-no-boost/vehicles/10
> {
>   "model" : "Silverado 2500HD"
> }
>
> When i tried to search with Query string "Chevy sivlerado", the synonym 
> matches perfectly to Silverado and gives back the result, on the contrary 
> when i tried to search via query string "2500 HD" it is returning 0 
> results. I tried different combination on the Synonym involving number and 
> found that elastic search synonym mapper does not support numbers is this 
> correct?
>
> is there any way i can make some mapping when user searches for "2500 HD", 
> i can map the query to "2500HD"
>

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/4981bbf5-86a7-4777-959c-c0b264deb900%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to