On Tue, Apr 28, 2009 at 3:18 PM, Otis Gospodnetic <
otis_gospodne...@yahoo.com> wrote:

>
> Hi,
>
> You should probably just look at the index version number to figure out if
> the name changed.  If you are looking at segments.gen, you are looking at a
> file that may not exist in Lucene in the future.  Use IndexReader API
> instead.


Yeah, I user IndexReader.isCurrent() to determine if I should "refresh" Solr
after catching a data grid event. But I have to create that event listener
somehow, and here I have no other way but to hardcode this index file name.
So when some node of the cluster performs commit, other nodes which listen
for segments.gen changes, receive the event and refresh their Solr instances
by calling SolrServer.commit().


> By "refreshes" do you mean "reopened a new Searcher"?  Does commit + post
> commit event not work for you?


Currently I use the following code to "refresh" cores:

new EnbeddedlSolrServer(cores, coreName).commit()


>
>
> By "kicks Solr" I hope you don't mean a Solr/container restart! :)


:) No, I mean the same "refresh" code i.e. calling SolrServer.commit().

-- 
Andrew Klochkov

Reply via email to