A poller really is the most sensible, practical, and easiest route to go. If you add the "versions=true" parameter to your update request and have the transaction log enabled the update response will have the version numbers for each document id, then the poller can also tell if an update has been committed as well.

Also, with soft commit, documents should be visible must more rapidly.

Do you have some other, unmentioned requirement that you feel is biasing you against a sensible poller? Clue us in as to the nature of such a requirement.

-- Jack Krupansky

-----Original Message----- From: Fredrik Rødland
Sent: Thursday, May 23, 2013 7:53 AM
To: solr-user@lucene.apache.org
Subject: hook to know when a DOC is committed.

I need to know when a document is committed in SOLR - i.e. is searchable.

Is there anyone who has a solution on how to do this.

I'm aware of three methods to create "hooks" for knowing when a doc is added or a commit is performed, but the doc(id) does not seem to be included for the commit-hooks (naturally I guess):

A. subclass DirectUpdateHandler2 and override commit and/or addDoc
B. subclass UpdateRequestProcessor (and include it in the update-chain) and override processAdd and/or processCommit C. implement SolrEventListener and implement postCommit and/or postSoftCommit

The use-case is to let other parts of a system know that a document is searchable without having to create a poller which has to have state on when/how it polls.

Any ideas or tricks out there?


Fredrik


--
Fredrik Rødland               Mail:    fredrik.rodl...@finn.no
FINN.no                       Cell:    +47 99 21 98 17
                             Twitter: @fredrikr
Oslo, NORWAY Web: http://about.me/fmr

Reply via email to