This week's book giveaway is in the JavaScript forum.
We're giving away four copies of JavaScript Promises Essentials and have Rami Sarieddine on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes hibernate search vs lucene Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate search vs lucene" Watch "hibernate search vs lucene" New topic
Author

hibernate search vs lucene

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Hello author,

Can you please the two and let us know the advantages and disadvantages.


Groovy
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Vs Lucene? Hibernate search uses Lucene, they are not competitors.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Thanks Paul. Can HS integrate with other frameworks similar to lucene ?
Emmanuel Bernard
author
Ranch Hand

Joined: Oct 22, 2008
Posts: 62
Hibernate Search uses Lucene and adds some sugar on it.

Some advantages of Hibernate Search over raw Lucene:
- changes in your database (made by Hibernate Core) are propagated transparently for you to the Lucene index
- indexing is optimized for you. HSearch does for Lucene that Hibernate Core does for JDBC
- queries return managed objects instead of the Lucene Document (which is basically a hashMap of Strings
- clustering out of the box
Emmanuel Bernard
author
Ranch Hand

Joined: Oct 22, 2008
Posts: 62
Hibernate Search uses Lucene. The reason of our choice is mainly:
- OSS
- the best and most popular full-text search library out there

While we could theorically use a different search engine, it is not possible today. Unfortunately the Full-text world does not offer a standard (there is no JPA spec for full-text search) and differences between libraries are quite big.

That being said, integrating with Solr (a product build on top of Lucene too) is probably possible with some work (not trivial but possible I think).
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Thanks for your replies.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Are are comparable frameworks like HS around ?
Emmanuel Bernard
author
Ranch Hand

Joined: Oct 22, 2008
Posts: 62
The closest framework is probably Compass but the emphasis is different (check one of the post from yesterday, we discussed that).
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Thanks. I will search for the thread you are talking about.Can you tell me whether HS supports pagination?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes it does. See this useful link.
Emmanuel Bernard
author
Ranch Hand

Joined: Oct 22, 2008
Posts: 62
Yes paginations are supported and with your favorite (Hibernate Core) APIs

Query query = //create my fullTextQuery
query.setFirstResult(100).setMaxResults(50);
List results = query.list();


Paul's link has more infos.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hibernate search vs lucene