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 search across multiple columns in MYSQL database, and I am using Hibernate Search (which uses lucene internally) for them.

Now my question is what to do in case of simple database searches that are not full text. Finding a shape:

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

      

Will this search be better if I use hibernate search or there will be no performance impact since this is not a full text search

+3


source to share


1 answer


You will definitely get a performance boost with Lucene / Hibernate search. The reason is that it will maintain the index locally and then use it for searches instead of querying the database for results, so this will reduce your network traffic and reduce the load on the database.



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

+4


source







All Articles