Filters:
Tokenizer:
Analyzers:
PUT /synonym_test
{
"settings": {
"index": {
"max_ngram_diff": 99,
"analysis": {
"analyzer": {
"synonym_analyzer": {
"tokenizer": "whitespace",
"filter": [
"synonym"
]
},
"autocomplete_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"autocomplete_filter"
]
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms": [
"unlimited => infinity",
"chaos => war"
]
},
"autocomplete_filter": {
"type": "ngram",
"min_gram": 1,
"max_gram": 20
}
}
}
}
}
}
PUT /synonym_test/_mapping/doc
{
"properties": {
"movie_name": {
"type": "text",
"analyzer": "autocomplete_analyzer",
"search_analyzer": "synonym_analyzer",
"copy_to": "query_text"
},
"year": {
"type": "text",
"analyzer": "autocomplete_analyzer",
"search_analyzer": "synonym_analyzer",
"copy_to": "query_text"
},
"subtitle": {
"type": "text",
"analyzer": "autocomplete_analyzer",
"search_analyzer": "synonym_analyzer",
"copy_to": "query_text"
},
"query_text": {
"type": "text"
}
}
}
GET /synonym_test/_search
{
"query": {
"multi_match" : {
"query": "2014 malay",
"fields": [ "movie_name", "year", "subtitle" ],
"fuzziness": "auto"
}
}
}