You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Stephane Bailliez <sb...@gmail.com> on 2013/04/11 17:30:25 UTC
Solr 4.2.x replication events on slaves
In Solr 3.x, I was relying on a postCommit call to a listener in the update
handler to perform data update to caches, this data was used to perform
'realtime' filtering on the documents.
So something like:
<updateHandler ...>
...
<listener event="postCommit" class="mypackage.IndexUpdateListener"/>
</updateHandler>
In Solr 4.2.x, the postCommit is not called anymore on the slaves during
updates. (I agree the concept outlined above is kind of blurry when
thinking in term of NRT updates, but here it is more batch updates)
What would be a suggested alternative to hook up something similar and
basically receive events related to replication ?
Thanks
- stephane
Re: Solr 4.2.x replication events on slaves
Posted by Chris Hostetter <ho...@fucit.org>.
: In Solr 3.x, I was relying on a postCommit call to a listener in the update
: handler to perform data update to caches, this data was used to perform
: 'realtime' filtering on the documents.
I can't find it at the moment, but IIRC this was a side effect of how
snapshots are now loaded on slaves -- there is no longer an explicit
"commit" to read in the new index.
For your usecase however, i think what would make more sense (and probably
would have always made more sense) is to implement this using the
"newSearcher" hook, which allows you to block usage of the newSearcher
until you have finished your hook logic.
Alternatively, you can implement CacheRegenerator which was specifically
designed for warming caches on newSearcher events, and gives you access to
the current cache keys so you can see what items where in the old
caches to warm.
-Hoss