I have added synonym mapping as per the given format. It is added on the settings. The mapping has "universe" mapped to "cosmos".
The below URI search gives me a match
_localhost:9200/indexname/search?q=data.summary:cosmos
But this one does not work.
_localhost:9200/indexname/search?q=cosmos
Why ?
I want to search across all the fields and still make a match. That is not working. I have given settings and JSON below.
Settings JSON
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 2,
"index": {
"analysis": {
"analyzer": {
"synonym_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"synonym"
]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "analysis/synonym.txt",
"tokenizer": "whitespace"
}
}
}
}
},
"mappings": {
"doc": {
"properties": {
"data": {
"properties": {
"summary": {
"type": "text",
"store": true,
"analyzer": "synonym_analyzer"
}
}
}
}
}
}
}
}
JSON Document
{
"guid": "123",
"data": {
"summary": "All Space-X rockets going to the universe",
"status": "Active"
}
}