Hi,
I need to iterate over whole result set, meaning all of
hits.getTotalHits() results from response (for some query). Required
'size' is not defined before I execute query (I need all matches), so I
can not use query.setSize(N).
What is the best way to get 'total hits' iterator and iterate over
potentiality big results set?
I could execute 'count query' to get the number of matches for that
query and use query.setSize(count query result) in main query, but I'm
not sure this approach scales very well (I need to be able to iterate
over possibly millions of documents)
Hi,
I need to iterate over whole result set, meaning all of
hits.getTotalHits() results from response (for some query). Required
'size' is not defined before I execute query (I need all matches), so I
can not use query.setSize(N).
What is the best way to get 'total hits' iterator and iterate over
potentiality big results set?
I could execute 'count query' to get the number of matches for that
query and use query.setSize(count query result) in main query, but I'm
not sure this approach scales very well (I need to be able to iterate
over possibly millions of documents)
Hi,
I need to iterate over whole result set, meaning all of
hits.getTotalHits() results from response (for some query). Required
'size' is not defined before I execute query (I need all matches), so I
can not use query.setSize(N).
What is the best way to get 'total hits' iterator and iterate over
potentiality big results set?
I could execute 'count query' to get the number of matches for that
query and use query.setSize(count query result) in main query, but I'm
not sure this approach scales very well (I need to be able to iterate
over possibly millions of documents)
Hi,
I need to iterate over whole result set, meaning all of
hits.getTotalHits() results from response (for some query). Required
'size' is not defined before I execute query (I need all matches), so I
can not use query.setSize(N).
What is the best way to get 'total hits' iterator and iterate over
potentiality big results set?
I could execute 'count query' to get the number of matches for that
query and use query.setSize(count query result) in main query, but I'm
not sure this approach scales very well (I need to be able to iterate
over possibly millions of documents)
One thing to remember though, scrolling is a heavy operation (its like
a cursor in a database), and also you won't get duplicates or anything like
that (actually, you won't see any changes done after you started the first
scroll). So, it should not be heavily used.
Hi,
I need to iterate over whole result set, meaning all of
hits.getTotalHits() results from response (for some query). Required
'size' is not defined before I execute query (I need all matches), so
I
can not use query.setSize(N).
What is the best way to get 'total hits' iterator and iterate over
potentiality big results set?
I could execute 'count query' to get the number of matches for that
query and use query.setSize(count query result) in main query, but I'm
not sure this approach scales very well (I need to be able to iterate
over possibly millions of documents)
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.