Hi Dominik,

I think most of your questions are answered in the Lucene FAQ and various 
Lucene articles, so I'll be brief.

----- Original Message ----
From: Dominik Bruhn <[EMAIL PROTECTED]>
To: java-user@lucene.apache.org
Sent: Saturday, June 10, 2006 6:58:03 PM
Subject: Lucene as Search in a BuletinBoard

Hy,
Im writing a kind of bulletin-board-software in java (servlet+velocity as 
template framework, mysql5 as backend). As the whole database is in INNODB 
and this doesn't support Fulltext-Indexes I looked for alternatives and liked 
the concept of Lucene. But I got serveral questions:

1. Everybody says that Lucene is faster than a MySQL-Fulltext Index. But how 
comes: MySQL can cache the results in RAM (at least when small) but Lucene 
has to open the index on the harddisk uppon any search. Why is this so 
performant. 

OG: You can open the index only once and reuse IndexReader/Searcher for 
multiple searches.

2. (Connected to 1): Is there a possibility to tell Lucene to keep the Index 
in RAM so the access is faster?

OG: Yes.  Look eda FSDirectory and RAMDirectory.

3. Is the following use of lucene ok?
Uppon every posting:
After inserting the post into the database-tables I create a IndexWriter, 
write the new Document and then close the writer again.

OG: Yes.  Also look at IndexModifier and consider batching delete and add 
operations when you can.

Uppon every editing of a post:
I create a IndexReader delete the old Data, close the reader, create a writer, 
save the document and the close the writer

OG: Yes.  Also look at IndexModifier and consider batching delete and add 
operations when you can.
 
Uppon every search:
I create a IndexReader and search.

OG: You can reuse it.  This must be in the FAQ on the Wiki.

Isn't it possible to reuse the IndexReader? I thought about creating it one 
time uppon startup of the servlet and the reuse it. But as I read in the 
documentation this would result in a locking issue uppon writing. Is this 
correct?

OG: Yes and then no.  Yes, you can reuse it.  No, no locking issues.

4. I read about the possibility to store the index in a database. When would 
you consider using this? Is this more performant that a disk-version?

OG: No, it is actually slower, people say.

Otis





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to