Different counts on match_all

Hi everyone.

I'm getting bit strange results for results counts. Basically they are different every time:

eqx-web6:/home/es/tests# while true; do date && curl -XGET 'http://localhost:9200/standard/_count' -d '{"match_all" : { }}' && echo; sleep 1; done;
Wed Aug 25 17:21:31 CEST 2010
{"count":8647582,"_shards":{"total":16,"successful":16,"failed":0}}
Wed Aug 25 17:21:32 CEST 2010
{"count":8647579,"_shards":{"total":16,"successful":16,"failed":0}}
Wed Aug 25 17:21:33 CEST 2010
{"count":8647564,"_shards":{"total":16,"successful":16,"failed":0}}
Wed Aug 25 17:21:34 CEST 2010
{"count":8647582,"_shards":{"total":16,"successful":16,"failed":0}}
Wed Aug 25 17:21:35 CEST 2010
{"count":8647579,"_shards":{"total":16,"successful":16,"failed":0}}
...

I assuming that they are just estimates, but how can I reliably get to the last 10 results? Querying for the last "page" sometimes gives me some results and sometimes no results at all.

Thank you in advance,

-- Michael Korbakov

Hi Michael

I'm getting bit strange results for results counts. Basically they are
different every time:

  • what version are you using?

  • how many nodes?

  • are you doing any indexing or deleting while running these queries

  • try flushing before you run your counts:

    curl -XPOST 'http://127.0.0.1:9200/_flush?refresh=true'

clint

eqx-web6:/home/es/tests# while true; do date && curl -XGET
'http://localhost:9200/standard/_count' -d '{"match_all" : { }}' &&
echo; sleep 1; done;
Wed Aug 25 17:21:31 CEST 2010
{"count":8647582,"_shards":{"total":16,"successful":16,"failed":0}}
Wed Aug 25 17:21:32 CEST 2010
{"count":8647579,"_shards":{"total":16,"successful":16,"failed":0}}
Wed Aug 25 17:21:33 CEST 2010
{"count":8647564,"_shards":{"total":16,"successful":16,"failed":0}}
Wed Aug 25 17:21:34 CEST 2010
{"count":8647582,"_shards":{"total":16,"successful":16,"failed":0}}
Wed Aug 25 17:21:35 CEST 2010
{"count":8647579,"_shards":{"total":16,"successful":16,"failed":0}}
...

I assuming that they are just estimates, but how can I reliably get to
the last 10 results? Querying for the last "page" sometimes gives me
some results and sometimes no results at all.

Thank you in advance,

-- Michael Korbakov

--
Web Announcements Limited is a company registered in England and Wales,
with company number 05608868, with registered address at 10 Arvon Road,
London, N5 1PR.