[hibernate-dev] HSearch 5.0

Marc Schipperheyn m.schipperheyn at gmail.com
Thu Aug 21 12:26:56 EDT 2014


On Aug 21, 2014 12:08 PM, "Sanne Grinovero" <sanne at hibernate.org> wrote:

> Hi Marc,
> the QueryTimeJoin is indeed very interesting but since the user needs
> to mark the "join point" somehow I hope we'll be able to build it as a
> new feature (probably with its own new annotation) in some 5.next ?
>
QueryTimeJoin doesn't require index time specifications, so yes, you could
specify a join with an annotation, perhaps this is conceptually more
in-line with Hibernate ORM, but it could just as easily be done though an
extension of the QueryBuilder.

So basically, the idea of the QueryTimeJoin is filter the root class with
results from a query that hits a different index, much like the SQL where
someId in (select id from X) style queries. I could imagine something like
this:

QueryBuilder postQueryBuilder
= fts.getSearchFactory().buildQueryBuilder().forEntity(Post.class).get();

QueryBuilder commentQueryBuilder
= fts.getSearchFactory().buildQueryBuilder().forEntity(Comment.class).get();
 postQueryBuilder.join().onField("id").referencing("post.id
").onEntity(Comment.class).withQuery(
      commentQueryBuilder.keyword().onField("type"
).matching("A").createQuery()
 ).createQuery();

At this point you seem you have more experience with it, so please
> correct me if I'm wrong :-)
>
> On performance, that's actually one of the reasons why I'm so
> interested in these other tests I've been spending time one: seems
> Lucene 4 is not always more efficient than Lucene 3, so I need to
> understand if we're missing something significant.
>

Interesting. With all I've read and the maturity of this version you would
think....

Another thing I forgot to mention is that I'm hoping that I will be able to
dump Bobo Browse in favor of Hibernate Search faceting. Currently, HSearch
is too limited still in this respect and I hope this will change with the
new features of Lucene in this area.

Cheers,
Marc


More information about the hibernate-dev mailing list