How to se the max number of hits?

Is there a way to set the max number of hits via the Java API? I'm using
the size parameter for itemsPerPage, but I need to cap the max hits that
are returned.

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

Hey,

sorry I cannot follow you. Using size and from parameters helps you to
define the amount of SearchHits being returned. Of what different kind of
max hits are you speaking? Can you provide an example maybe?

--Alex

On Wed, Jul 10, 2013 at 4:57 PM, dan dan.tuffery@gmail.com wrote:

Is there a way to set the max number of hits via the Java API? I'm using
the size parameter for itemsPerPage, but I need to cap the max hits that
are returned.

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

If I do a search for "book" and there are 5000 book items in my index but I
only want user to only be able to search over the fist 2000 hundred I need
a way to cap the totalHits. This is different from the 'from' and 'size'
parameters as that is what I use for pagination, i.e. the 'from' is the
page the user is starting from, say '21' and the 'size' is the items per
page say '20'.

On Wednesday, July 10, 2013 4:54:14 PM UTC+1, Alexander Reelsen wrote:

Hey,

sorry I cannot follow you. Using size and from parameters helps you to
define the amount of SearchHits being returned. Of what different kind of
max hits are you speaking? Can you provide an example maybe?

--Alex

On Wed, Jul 10, 2013 at 4:57 PM, dan <dan.t...@gmail.com <javascript:>>wrote:

Is there a way to set the max number of hits via the Java API? I'm using
the size parameter for itemsPerPage, but I need to cap the max hits that
are returned.

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

If I do a search for "book" and there are 5000 book items in my index but I
only want user to only be able to search over the fist 2000 I need a way to
cap the 'totalHits'. This is different from the 'from' and 'size'
parameters as that is what I use for pagination, i.e. the 'from' is the
page the user is starting from, say '21' and the 'size' is the items per
page say '20'.

On Wednesday, July 10, 2013 4:54:14 PM UTC+1, Alexander Reelsen wrote:

Hey,

sorry I cannot follow you. Using size and from parameters helps you to
define the amount of SearchHits being returned. Of what different kind of
max hits are you speaking? Can you provide an example maybe?

--Alex

On Wed, Jul 10, 2013 at 4:57 PM, dan <dan.t...@gmail.com <javascript:>>wrote:

Is there a way to set the max number of hits via the Java API? I'm using
the size parameter for itemsPerPage, but I need to cap the max hits that
are returned.

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

Hey,

this is an application issue and should be solved there as well. Simply
exchange the values from the JSON response if you need to and do not allow
to page that far (which should be easy as this is user input).
There is now way to tell elasticsearch to hide found hits... (doesnt make
sense for a search engine to hide results which are clearly hits).

--Alex

On Wed, Jul 10, 2013 at 6:09 PM, dan dan.tuffery@gmail.com wrote:

If I do a search for "book" and there are 5000 book items in my index but
I only want user to only be able to search over the fist 2000 I need a way
to cap the 'totalHits'. This is different from the 'from' and 'size'
parameters as that is what I use for pagination, i.e. the 'from' is the
page the user is starting from, say '21' and the 'size' is the items per
page say '20'.

On Wednesday, July 10, 2013 4:54:14 PM UTC+1, Alexander Reelsen wrote:

Hey,

sorry I cannot follow you. Using size and from parameters helps you to
define the amount of SearchHits being returned. Of what different kind of
max hits are you speaking? Can you provide an example maybe?

--Alex

On Wed, Jul 10, 2013 at 4:57 PM, dan dan.t...@gmail.com wrote:

Is there a way to set the max number of hits via the Java API? I'm using
the size parameter for itemsPerPage, but I need to cap the max hits that
are returned.

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

For more options, visit https://groups.google.com/**groups/opt_outhttps://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.

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