On 5/28/2014 3:45 AM, M, Arjun (NSN - IN/Bangalore) wrote:
>       Also is there a way to check if autowarming completed (or) how to make 
> the next commit wait till previous commit finishes?

With Solr, probably not.  There might be a statistic available from an
admin handler that I don't know about, but as far as I know, your code
must be aware of approximately how long a commit is likely to take, and
not send another commit until you can be sure that the previous commit
is done.  This includes the commitWithin parameter on an update request.

Now that I've just said that, you *can* do an all documents query with
rows=0 and look for a change in numFound.  An update might actually
result in no change to numFound, so you would need to build in a
time-based exit to the loop that looks for numFound changes.

In the case of commits done automatically by the configuration
(autoCommit and/or autoSoftCommit), there is definitely no way to detect
when a previous commit is done.

The general recommendation with Solr 4.x is to have autoCommit enabled
with openSearcher=false, with a relatively short maxTime -- from 5
minutes down to 15 seconds, depending on indexing rate.  These commits
will not open a new searcher, and they will not make new documents visible.

For commits that affect which documents are visible, you need to
determine how long you can possibly stand to go without seeing new data
that has been indexed.  Once you know that time interval, you can use it
to do a manual commit, or you can set up autoSoftCommit with that
interval.  It is not at all unusual to have an autoCommit time interval
that's shorter than autoSoftCommit.

This blog post mentions SolrCloud, but it is also applicable to Solr 4.x
when NOT running in cloud mode:

http://searchhub.org/2013/08/23/understanding-transaction-logs-softcommit-and-commit-in-sorlcloud/

Thanks,
Shawn

Reply via email to