You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Ard Schrijvers <a....@hippo.nl> on 2007/08/16 13:49:43 UTC

jcr observation event after node/prop has been indexed

Hello,

does anybody know wether it is possible to add listeners that get an event *after* a node is indexed instead of added? Frequently, I am interested in an event that a node is added/changed/removed *after* the indexing has been done. A simple usecase is for example a frontend eventbased cache for queries/searches. Invalidating a cache before the index has been updated might result a in new search on the 'old' index, that stores a new eventbased cached result, which obviously is not the correct one (and the invalidation event has already been processed). 

So, does anybody know wether this is already present in JackRabbit?

Regards Ard

Re: jcr observation event after node/prop has been indexed

Posted by Marcel Reutegger <ma...@gmx.net>.
Ard Schrijvers wrote:
> does anybody know wether it is possible to add listeners that get an event
> *after* a node is indexed instead of added? Frequently, I am interested in an
> event that a node is added/changed/removed *after* the indexing has been
> done. A simple usecase is for example a frontend eventbased cache for
> queries/searches. Invalidating a cache before the index has been updated
> might result a in new search on the 'old' index, that stores a new eventbased
> cached result, which obviously is not the correct one (and the invalidation
> event has already been processed).
> 
> So, does anybody know wether this is already present in JackRabbit?

I'm not sure I understand your question because in Jackrabbit regular 
EventListener are always called after the content is indexed. I wrote 'regular' 
because you can also register a listener that implements 
org.apache.jackrabbit.core.observation.SynchronousEventListener, in which case 
the listener might be called before content is indexed. the QueryHandler itself 
gets notified about changes using a SynchronousEventListener.

regards
  marcel