Skip to main content

Inconsistent Elasticsearch scores with async python client

I'm consuming an elastic search cluster with 3 nodes and keep receiving consistent results for only a very short period of time despite having defined the preference parameter.

I found the following litterature and I could not really understand what am I missing:

I'm looking for recommendations on how to address this issue or aspects I might be missing as it starts to be annoying once we start using pagination.

My client is defined as following:

es_client = AsyncElasticsearch(
        hosts=[3 nodes],
        ...
        sniff_timeout=10,
        sniffer_timeout=60,
        sniff_on_connection_fail=True,
        max_retries=5,
        retry_on_timeout=True,
        request_timeout=30,
    )

and I execute my search as:

resp = await es.search(query=query, index=index, source=source, size=size, from_=from_, preference=preference
    )

Thanks for any help



source https://stackoverflow.com/questions/77099831/inconsistent-elasticsearch-scores-with-async-python-client

Comments