Sir If i run this query then it will give
value: <=10,000(if this much or more than that records are there)
hits: 10
To manage hits we can use "from" : 0, "size" : 10,
But i want to ask you that for using size, i need to pre-define the size value to tell that how much records value i want
Can you tell what can i use as a size value so that it will automatically give/fetch the total number of result value so that i don't need to pre-define the size.
I know that the maximum value should be 10,000
but if the value if <=10,000 then should i write any value of size so that it will automatically detect the total record
Because sometimes we don't know that how much records we will get as result
the size and from parameters to display by default up to 10000 records to your users. If you want to change this limit, you can change index.max_result_window setting but be aware of the consequences (ie memory).
It's not possible and it does not really make sense as you probably don't want to display to the use a page which has 10m of documents.
But you want either to:
Paginate: use from / size
Do deep pagination: use search after
Extract all the data for another usage than displaying (compute for example): use scroll
If you have a different use case, could you describe it?
Sir,
Can you please tell me that
if i have a total result of 37(just taking this value as a example, it can be 997, 9897, etc.)
and every time i will send a request to my java class in which i will update the values of "from" and "size" like
from=0, size=10 -----for First iteration
from=10, size=20 -----for Second iteration
(i will increment the values of "from" and "size" by 10 after every iteration)
will it give an error or not when i will be iterating 4th time in which from="30" and size="40" but records will be between >=30 and <=40
as my size value would be 40(size="40") but total records are 37
Other Scenario
will this way will help me with 10,000+ records because i will fetch only 10 records at a time
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.