我在使用弹性搜索时遇到了问题。在对相同数据使用相同查询进行搜索时,ES仅在备用调用中返回相同的_meta.score (结果)。也就是说,如果结果的_meta.score在第一次调用时为“A”,则在第二次调用时返回“B”,在第三次调用时返回“A”,在第四次调用时返回“B”,依此类推。我在 python 中使用 PyES 包装器。
以下是我为 PyES 设置的设置
SETTINGS = {"index": {
"analysis": {"char_filter": {"my_mapping": {
"type": "mapping", "mappings": ["\\u0091=>\\u0027", "\\u0092=>\\u0027",
"\\u2018=>\\u0027", "\\u2019=>\\u0027",
"\\u201B=>\\u0027"]}},
"filter": {"english_stop": {
"type": "stop", "stopwords": "_english_"}},
"analyzer": {"wsplusstop": {
"type": "custom",
"char_filter": "my_mapping",
"tokenizer": "whitespace",
"filter": ["lowercase", "english_stop",
"porter_stem"]}}}}}