Skip to content

Instantly share code, notes, and snippets.

@bhavsarpratik
Last active June 7, 2020 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhavsarpratik/3ae9292b058cab79fbd0af32a6c8f2f0 to your computer and use it in GitHub Desktop.
Save bhavsarpratik/3ae9292b058cab79fbd0af32a6c8f2f0 to your computer and use it in GitHub Desktop.
PUT /test_index
{
"mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "synonym_analyzer",
"search_analyzer": "synonym_analyzer"
},
"title_vector": {
"type": "dense_vector",
"dims": 512
}
}
},
"settings": {
"index": {
"analysis": {
"analyzer": {
"synonym_analyzer": {
"tokenizer": "standard",
"filter": ["my_stop", "synonym"]
}
},
"filter": {
"my_stop": {
"type": "stop",
"stopwords": ["the"]
},
"synonym": {
"type": "synonym",
"lenient": true,
"synonyms": ["pussy => cat"]
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment