Sreejithc321
Sreejithc321

Reputation: 307

Elasticsearch ranking issue

I am facing a strange but odd issue in Elasticsearch ranking results.

The problem is Elasticsearch results are not consistent.

For the same set of documents and query, Elasticsearch is returning different answers !! The first 10 results are always the same for the query but vary from thereafter.

How can this be rectified?

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

Mapping:

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

Tools and versions used:

Python : 2.7, Pyes : 0.99.6, Elasticsearch : 5.4.3

Upvotes: 1

Views: 77

Answers (0)

Related Questions