You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Puneet Lakhina <pu...@gmail.com> on 2006/07/19 15:29:20 UTC

Lucene with Simple Database

hi,
I have till now used lucene mainly for searching through text files. I
wanted to know if its sensible to use lucene with a database which does not
have fields with large text values.
for e.g. a table like

id       Name            Address
1        Name1          name1,strreet1,city1,country1
2        Name2          name2,strreet2,city2,country2
3        Name3          name3,strreet3,city3,country3
4        Name4          name4,strreet4,city4,country4

with abt a 10000 records like this.

Is it worth using and maintaining a lucene index instead of just creating
indices in the database on the fields to be searched for. Will using lucene
offer any significant performance benefit.
How much of a performance overhead will updating the index(each time the
database changes) would be.
All these fields need not be analyzed.

ANy help would be gr8.
-- 
Puneet

Re: Lucene with Simple Database

Posted by Erick Erickson <er...@gmail.com>.
Well, it depends. Are you having performance problems with a database
solution? If not, why in the world would you want to introduce another layer
of complexity?

Personally, while I think Lucene is great, I wouldn't recommend it in the
situation you describe unless you are having problems with the database
solution. 10,000 records shouldn't make any reasonable database even start
to breathe hard, unless you're using it in ways that don't readily come to
my mind.

And if you are having performance issues, the first thing I'd do is look at
making my database use more efficient.

This assumes you *need* a database. If you are just searching records (and
not joining across tables etc.), then you might think about forgetting the
database all together and just using Lucene.

But I can't stress enough that introducing solution that requires both a DB
and Lucene just to be "more efficient" is a bad idea. It's may be a good
thing if you are solving a real problem, but not an abstract "it would just
be better" problem. And in either case, a dual solution shouldn't be
approached until after you've made sure your problem is not just mis-use of
the tool you're using.

Best
Erick