[hibernate-dev] Interceptor question

Emmanuel Bernard emmanuel at hibernate.org
Fri May 11 14:22:56 EDT 2012

The reason I did map manual indexing to apply default is that I sided with Sanne s reasoning and I went on the side of caution with the API. I'd love to get more practical feedback before deciding to either:

- stay as it is
- map indexing and purge to the interceptor - I don't think we can safely map purge all
- add two methods to the interceptor to treat index and purge explicitly


On 11 mai 2012, at 17:45, Hardy Ferentschik <hardy at ferentschik.de> wrote:

> Really? I would argue differently. 
> Let's take the blog example where I only want to index blog entries which are 
> published. Adding the interceptor and relying on automatic indexing will not index un-published entries. Great.
> If I, however, want/ have to re-index my blog entries via the API  the interceptor does not apply? Why?
> IMO the interceptor has to apply for automatic index updates as well as explicit index request. Conceptually
> (for a user) there is no difference between explicitly calling FulltextSession#index or auto-indexing. That's 
> exactly the type of confusion the user on the forum experienced. 
> I think we should change this behavior.
> --Hardy
> On May 11, 2012, at 5:23 PM, Sanne Grinovero wrote:
>> As a user if I were asking to Search *explicitly* to index my entity,
>> I would not be pleased in the framework to override my request... I
>> think the code is correct, maybe it's worth pointing this out at least
>> on #index() javadoc?
>> Sanne
>> On 11 May 2012 14:48, Hardy Ferentschik <hardy at ferentschik.de> wrote:
>>> Hi,
>>> quick question regarding the indexing interceptor. Why is WorkType.Index mapped to IndexingOverride.APPLY_DEFAULT -
>>> https://github.com/hferentschik/hibernate-search/blob/master/hibernate-search-engine/src/main/java/org/hibernate/search/backend/impl/TransactionalWorker.java#L132
>>> Shouldn't it be the same as ADD? Am I missing something? I am asking, because of https://forum.hibernate.org/viewtopic.php?f=9&t=1015173
>>> --Hardy

More information about the hibernate-dev mailing list