[hibernate-dev] Hibernate Search 4.4.0.Alpha1 release

Guillaume Smet guillaume.smet at gmail.com
Mon Aug 5 09:44:09 EDT 2013


(Hardy, sorry for the double post, forgot the list)

On Mon, Aug 5, 2013 at 3:20 PM, Hardy Ferentschik <hardy at hibernate.org> wrote:
> TBH i am not completely sure I understand what the method does. The docs says:
>
> "From the set of classes a new set is built containing all indexed subclasses, but removing then all subtypes of
> indexed entities."
>
> Not sure what exactly that means. What are you using this method for? Maybe you could
> provide a use case.

Well, we use it for our mass indexing magic button to index one class
at a time. Otherwise the mass indexer requires too many db connections
when we have too many entities: there are a couple of forum posts and
JIRA issues about this problem.

The purpose of the "rootification" done in the mass indexer is that if you have:
Vehicle > Car
           > Truck
Animal > Cat
           > Dog
the toRootEntities only returns Vehicle and Animal so that you can
send them to the mass indexer machinery. Otherwise, you will reindex
Car, Truck, Cat and Dog 2 times (one time when you deal with the
parent class and one time when you deal with the child one).

> Do you have any suggestion on how to add this into the the current API? Do you want to
> have something like isRoot on IndexedTypeDescriptor (thought I am not quite sure yet what
> "root" means in this case.

isRoot more or less means isRootInIndexedClassHierarchy.

I thought of adding a getRootIndexedTypes() as the mass indexer code
is well tested and based on this principle but I agree it's probably
nicer to put it in IndexedTypeDescriptor.

One way or another, it would be nice to be able to do that without ugly hacks.

-- 
Guillaume


More information about the hibernate-dev mailing list