On 5 Jan 2013, at 3:44 PM, Guillaume Smet <guillaume.smet(a)gmail.com> wrote:
(Hardy, sorry for the double post, forgot the list)
On Mon, Aug 5, 2013 at 3:20 PM, Hardy Ferentschik <hardy(a)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).
Ok, I see. Could you create a Jira issue for that. I think we need to discuss this also a
bit more.
This looks more like a ORM optimisation thing than a Search specific thing. Technically
Vehicle and Animal are not indexed types. Car, Truck, Dog and Cat are. At least that is
my
initial thinking. I'll need to think a bit more ago about this one.
--Hardy