Requested size is 1 for the query, but when the query is run on all the 8 shards it returns 8 records

Hi,

This post is related to the below one.
https://groups.google.com/d/topic/elasticsearch/jJnOcAVP_L4/discussion

The query has a from:"0" and size:"1", but this query gets 1 record from
each of the 8 shards on the index and the java API displays 8 records. I'm
not sure if this is some configuration issue.

Thanks,
John

--
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.

Did you change your search type to query_and_fetch? With query_and_fetch,
you will get n results from each shard, where n is the size requested.
Default search type is query_then_fetch.

--
Ivan

On Fri, Feb 22, 2013 at 12:10 PM, john john2roll2@gmail.com wrote:

Hi,

This post is related to the below one.
https://groups.google.com/d/topic/elasticsearch/jJnOcAVP_L4/discussion

The query has a from:"0" and size:"1", but this query gets 1 record from
each of the 8 shards on the index and the java API displays 8 records. I'm
not sure if this is some configuration issue.

Thanks,
John

--
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.

--
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.

It's hard to follow you in what your curl line looks like, so it's hard
to comment. In Java API you use DFS query then fetch. So I think you
also used in curl the parameter search_type= dfs_query_then_fetch. Also,
you used setExplain(true) in Java which means, curl should have run
through the _explain endpoint. But I am not sure.
I suggest you respect both parameters (explain and search_type) and
then, result size should be the same.

Jörg

Am 22.02.13 21:10, schrieb john:

Hi,

This post is related to the below one.
https://groups.google.com/d/topic/elasticsearch/jJnOcAVP_L4/discussion

The query has a from:"0" and size:"1", but this query gets 1 record
from each of the 8 shards on the index and the java API displays 8
records. I'm not sure if this is some configuration issue.

--
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.

You're on it. That was it, thanks Ivan.

On Friday, 22 February 2013 14:15:35 UTC-6, Ivan Brusic wrote:

Did you change your search type to query_and_fetch? With query_and_fetch,
you will get n results from each shard, where n is the size requested.
Default search type is query_then_fetch.

Elasticsearch Platform — Find real-time answers at scale | Elastic

--
Ivan

On Fri, Feb 22, 2013 at 12:10 PM, john <john2...@gmail.com <javascript:>>wrote:

Hi,

This post is related to the below one.
https://groups.google.com/d/topic/elasticsearch/jJnOcAVP_L4/discussion

The query has a from:"0" and size:"1", but this query gets 1 record from
each of the 8 shards on the index and the java API displays 8 records. I'm
not sure if this is some configuration issue.

Thanks,
John

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.

Jörg, the code had been changed from the "DFS query then fetch" or "query
then fetch" to "query and fetch" by someone. Sorry about the confusion i
caused.

On Friday, 22 February 2013 14:21:52 UTC-6, Jörg Prante wrote:

It's hard to follow you in what your curl line looks like, so it's hard
to comment. In Java API you use DFS query then fetch. So I think you
also used in curl the parameter search_type= dfs_query_then_fetch. Also,
you used setExplain(true) in Java which means, curl should have run
through the _explain endpoint. But I am not sure.
I suggest you respect both parameters (explain and search_type) and
then, result size should be the same.

Jörg

Am 22.02.13 21:10, schrieb john:

Hi,

This post is related to the below one.
https://groups.google.com/d/topic/elasticsearch/jJnOcAVP_L4/discussion

The query has a from:"0" and size:"1", but this query gets 1 record
from each of the 8 shards on the index and the java API displays 8
records. I'm not sure if this is some configuration issue.

--
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.