Inconsistent results

Hi all,

I have a cluster with 4 nodes and I am running a very simple query:

curl -XPOST 'http://85.88.36.61:9200/ng0010185/_search?
search_type=dfs_query_then_fetch' -d '
{
"size": 10,
"query": {
"match_all" : {
}
}
}
'

Each time when I run the query I get different results in terms of the
documents returned. The number of hits is the same. In fact there seem
to be 2 types of results, obtained at every other run.

Why do I get this behaviour? Is there any way to make the search
consistent?

Thanks,
roxana

Hi there, Roxana. Try enabling the "explain" option to determine why you're
getting inconsistent results.

http://www.elasticsearch.org/guide/reference/api/search/explain.html

Cheers,
Nick

match_all has not guarantees for ordering (even when you do dfs phase). The
reason you see two sets of results is that it hits one set of shards, and
then another (within a shard, match_all will have the same order, but not
between a shard and its replica).

On Mon, Jan 23, 2012 at 12:50 PM, anghelutar anghelutar@gmail.com wrote:

Hi all,

I have a cluster with 4 nodes and I am running a very simple query:

curl -XPOST 'http://85.88.36.61:9200/ng0010185/_search?
search_type=dfs_query_then_fetch' -d '
{
"size": 10,
"query": {
"match_all" : {
}
}
}
'

Each time when I run the query I get different results in terms of the
documents returned. The number of hits is the same. In fact there seem
to be 2 types of results, obtained at every other run.

Why do I get this behaviour? Is there any way to make the search
consistent?

Thanks,
roxana

To ensure consistency you need to sort on a field other than score, as
score will be 1 for all documents.

Mark