Reputation: 97
I have products
index with mapping
"synonym" : {
"type" : "synonym",
"synonyms" : [
"netbook => laptop"
]
}
I want to search my products by query "lapt*" or "netb*"
Upvotes: 0
Views: 158
Reputation: 217304
If searching by lapt*
works but not netb*
then you need to change your synonyms filter to this (i.e. replace =>
by a comma):
"synonym" : {
"type" : "synonym",
"synonyms" : [
"netbook, laptop"
]
}
Using =>
replaces netbook
by laptop
and hence only the latter is indexed. Using a comma, will index both netbook
and laptop
and allow you to search for prefixes with both netb*
and lapt*
Upvotes: 2