1

我在 Elasticsearch 排名结果中遇到了一个奇怪但奇怪的问题。

问题是 Elasticsearch 结果不一致。

对于同一组文档和查询,Elasticsearch 会返回不同的答案!查询的前 10 个结果始终相同,但之后会有所不同。

如何纠正?

results = self.conn.search(query=some_query, explain=True, search_type="dfs_query_then_fetch")

映射:

{
    "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"
                    ]
                }
            }
        }
    }
}

使用的工具和版本:

Python:2.7,Pye:0.99.6,Elasticsearch:5.4.3

4

0 回答 0