Hi,
I have always been of the opinion that FullTextSession#index should also apply the
interceptor.
At the very least there should be an easy way use the interceptor via the index API.
On 21 Jan 2012, at 10:25 PM, Sanne Grinovero wrote:
Today, this method is ignoring the conditional indexing interceptor
altogether; this might be considered correct, but we should clarify it
as it brought some confusion.
IMO it is wrong
My first idea about this was to clarify in documentation &
javadoc
that the index() is going to ignore the interceptor. I thought that
would be a good idea so that users can have a method to override any
framework decision and force the write to be applied.
There interceptors application should be the default with an explicit
option/api/configuration to
disable it.
On the other hand, adding the methods mentioned in the FIXME would
be
straight forward too, and while I'd expect most people to implement
onIndex() as return APPLY_DEFAULT, this might be a more elegant way
to:
- let the user choose about this
- make it very explicit what is going to happen
-1 I don't think this is the right place to do it. onAdd, OnUpdate, etc are on a
different architectural level
than index() and purge(). The latter actually create onAdd and onUpdate calls. It feels
messy to add
these methods to the interface.
Wy not add an #index(Object, boolean) to FullTextSession? The flag would indicate whether
interceptors should
be applied or not. #index(Object) would then be the default index operation with the flag
set to true or false, depending
what we think should be the default.
--Hardy