fork https://github.com/bells/elasticsearch-analysis-dynamic-synonym
The dynamic synonym plugin adds a synonym token filter that reloads the synonym file (local file or remote file) at given intervals (default 60s).
6.8.1
mvn package
copy and unzip target/releases/elasticsearch-analysis-dynamic-synonym-{version}.zip
to your-es-root/plugins/dynamic-synonym
{
"index" : {
"analysis" : {
"analyzer" : {
"synonym" : {
"tokenizer" : "whitespace",
"filter" : ["remote_synonym"]
}
},
"filter" : {
"remote_synonym" : {
"type" : "dynamic_synonym",
"synonyms_path" : "http://host:port/synonym.txt",
"interval": 30
},
"local_synonym" : {
"type" : "dynamic_synonym",
"synonyms_path" : "synonym.txt"
}
}
}
}
}
synonyms_path
: A file path relative to the Elastic config file or an URL, mandatory
interval
: Refresh interval in seconds for the synonym file, default: 60
, optional
ignore_case
: Ignore case in synonyms file, default: false
, optional
expand
: Expand, default: true
, optional
format
: Synonym file format, default: ''
, optional. For WordNet structure this can be set to 'wordnet'
Last-Modified
and ETag
http header. If one of these changes, the synonyms will be reloaded.Note: File encoding should be an utf-8 text file.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。