Why can't I acquire all the search results?

Hi guys,

I am using ES0.90.0.Beta1 and make search in java api, while I found I
always could not get the whole search hits set.
For example, the size of search hits is 824 using prepareCount api, while I
could only acquire 822 hits using prepareSearch api with the same query.

CountResponse countResponse = client.prepareCount(indexName)
.setTypes("kba")
.setQuery(qb)
.execute()
.actionGet();

SearchResponse searchResp = client.prepareSearch(indexName)
.setTypes("kba")
.setQuery(qb)
.setFrom(from).setSize(size).setExplain(true)
.execute()
.actionGet();

so in my program, after I get the size of search hits using countSearch,
then I want to acquire all the results using prepareSearch.
At first, I thought it was caused by the timeout reason, but the problem
still exist even I set a timeout value for prepareSearch.
By the way, I am conducting search in an index including three indices all
with a same alias, would this affect?
Have anybody encountered this problem before.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

What value did you use as from argument in your search request?
What is the total hits count for the search request?
Did the data in your indices change between your count and search request?

A better mechanism to fetch all documents is the use the search type scan
instead of doing a count and several normal search requests:

On 18 April 2013 09:29, Jingang Wang bitwjg@gmail.com wrote:

Hi guys,

I am using ES0.90.0.Beta1 and make search in java api, while I found I
always could not get the whole search hits set.
For example, the size of search hits is 824 using prepareCount api, while
I could only acquire 822 hits using prepareSearch api with the same query.

CountResponse countResponse = client.prepareCount(indexName)
.setTypes("kba")
.setQuery(qb)
.execute()
.actionGet();

SearchResponse searchResp = client.prepareSearch(indexName)
.setTypes("kba")
.setQuery(qb)
.setFrom(from).setSize(size).setExplain(true)
.execute()
.actionGet();

so in my program, after I get the size of search hits using countSearch,
then I want to acquire all the results using prepareSearch.
At first, I thought it was caused by the timeout reason, but the problem
still exist even I set a timeout value for prepareSearch.
By the way, I am conducting search in an index including three indices all
with a same alias, would this affect?
Have anybody encountered this problem before.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Met vriendelijke groet,

Martijn van Groningen

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.