I am having trouble with synonyms
When I apply the following query, I get search results.
$search: {
"index": "fulltext",
"text": {
"query": "His my foot hurts orthopedic",
"path": ["locationName", "practicingSpecialty"],
//"synonyms": "synonyms1"
}
}
However, when I apply the following query, I get no search results at all::
$search: {
"index": "fulltext",
"text": {
"query": "His my foot hurts orthopedic",
"path": ["locationName", "practicingSpecialty"],
"synonyms": "synonyms1"
}
}
I have one synonym in my collection:
{
"mappingType": "equivalent",
"synonyms": ["knee", "Orthopedic", "Orthopedics", "Orthopedist"]
}
My index definition looks like the following:
{
"mappings": {
"dynamic": true
},
"synonyms": [
{
"name": "synonyms1",
"analyzer": "lucene.standard",
"source": {
"collection": "searchSynonyms"
}
}
]
}
When I apply a query the gets an “exact” match in a field then I get search results, but if there is not an exact match I get no results. I want to get search results where I have a fields that looks like this:
The ‘orthopedic’ term in the query above should match on Orthopedics in the practicingSpecialty field. Also, if I used the term ‘knee’, my synonym should apply ‘orthopedics’ and also get a match.
{
"gender": "Female",
"practicingSpecialty": "Orthopedics",
"practiceType": "Medical",
}
Wondering what I might be doing wrong?