gpt4 book ai didi

elasticsearch - 使用文件的 AWS Elasticsearch 同义词

转载 作者:行者123 更新时间:2023-11-29 02:51:53 25 4
gpt4 key购买 nike

我正在尝试使用文件向 Elasticsearch 添加同义词,如此链接中所示,但它给了我以下错误 https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-synonym-tokenfilter.html

error":{"root_cause":[{"type":"illegal_argument_exception","reason":"IOException while reading synonyms_path_path: ],"type":"illegal_argument_exception","reason":"IOException while reading synonyms_path_path:  (No such file or directory)"}},"status":400}

我的映射代码如下所示,synonyms.txt 位于同一文件夹(同一级别)中:

'settings': {
'analysis': {
'filter': {
'english_stemmer': {
'type': 'stemmer',
'language': 'english'
},
'english_possessive_stemmer': {
'type': 'stemmer',
'language': 'possessive_english'
},
'my_synonyms': {
'type': 'synonym',
'synonyms_path' : 'synonyms.txt'
}
},
'analyzer': {
'my_analyzer': {
'tokenizer': 'standard',
'filter': [
'english_possessive_stemmer',
'lowercase',
'my_synonyms',
'english_stemmer'
]
}
}
}
},
'mappings' : ...

最佳答案

实际上,您的问题是您显然无法向 AWS 提交同义词文件,并且在此配置中使用同义词的唯一方法是通过以下 API 上传同义词:

https://www.elastic.co/guide/en/elasticsearch/reference/5.5/analysis-synonym-tokenfilter.html

这对大量的同义词没有用。

请参阅类似问题的其他答案以供引用:

Is there any difference between using synonyms_path and using synonyms when specifying synonym filter for Elasticsearch?

这直接取自 AWS 论坛:

https://forums.aws.amazon.com/message.jspa?messageID=679800

顺便说一句,路径实际上应该是 analysis/synonyms.txt,但同样,前提是您能够将同义词文件上传到 AWS。

关于elasticsearch - 使用文件的 AWS Elasticsearch 同义词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45433446/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com