Abhishek Ranjan
Abhishek Ranjan

Reputation: 931

When to use Lucene/Hibernate Search

I am working on an application where we have different types of Searches.Some of them are full text searches over multiple columns in a MYSQL database and i am using Hibernate Search(which uses lucene internally ) for these.

Now my question is What to do in case of simple database searches which are not full text.A search of the form :

select * from table1,table2 where table1.col1='testval' and table1.col2=table2.col2;

Will such search be better if i use hibernate search or would there be no effect on performance,since this is not a full text search

Upvotes: 3

Views: 562

Answers (1)

chiastic-security
chiastic-security

Reputation: 20520

You will certainly get a performance improvement using Lucene / Hibernate Search. The reason is that it will maintain an index locally, and then use that for the search, rather than having to query the database to retrieve the results, so it will reduce your network traffic and reduce the load on the database.

Of course, for a simple application with network and database under a light load, you won't necessarily notice any difference, but when things start to scale up, you'll notice. The more you can do to avoid unnecessary database queries, the better.

Upvotes: 4

Related Questions