-1

I have some objects and I have two ways of storing them: using hibernate-search (lucene) with indexes, or as hibernate entities (postgres records).

I don't need full text search per se, just searching by the properties values (exact match) and maybe range.

Is there any performance comparison available for these two use cases?

Sanne
  • 6,027
  • 19
  • 34
IttayD
  • 28,271
  • 28
  • 124
  • 178
  • I find it highly improbable that you find this. The main reason is that it depends on a lot of factors. The performance for Hibernate queries depend more on the underliying database than in Hibernate itself so a "generic comparison" is not a logical thing to do. – Rafa de Castro Apr 19 '12 at 06:54
  • ok. so how about just postgres? and i'm looking for more clear-cut reply. if they are more or less comparable, depending on tuning, this is good. but if lucene is 100 time slower, then i guess the type of database doesn't matter. – IttayD Apr 19 '12 at 06:58

1 Answers1

2

The question is like comparing apple and pears. If you need persistent storage and the ability to query and retrieve entities you need to use hibernate core.

Hibernate Search is primarily an extension to Hibernate Core offering (full text) search. Yes is is possible to store the entity values in the index as well and retrieve them via projections. In this case, however, you are not dealing with entities anymore, but with object arrays. You are missing out on the life cycle gurantees Hibernate offers.

My guess would be that you want Hibernate Core (ORM) plus Criteria queries.

Hardy
  • 18,659
  • 3
  • 49
  • 65