-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erik Hatcher
Sent: Thursday, December 02, 2004 4:45 PM
To: Research Triangle Java User's Group mailing list.
Subject: Re: [Juglist] I need to integrate a search engine into a
J2EEbasedwebsite
On Dec 2, 2004, at 3:08 PM, Zhiyong Li wrote:
> It is pretty easy to integrate and get started. In general, it is a
> good tool.
>
> Two things that you may want to be aware:
>
> (1) The concurrent update in Lucene is not intuitive. If the contents
> that you will search change very frequently, you may have more work to
> do to get it right.
The concurrent update rule is simple: only one instance of IndexWriter
may be writing to the index at a time. Multiple threads may be using
that same instance, however. Depending on what you're doing, this
certainly may involve implementing some type of queuing or batch
mechanism.
> (2) If you do the updates as a backend process, dependent on your
> architecture, it is general not recommended to start a new threads
> from the application code.
What does this have to do with Lucene? Lucene is quite happy in
multi-threaded environments.
<Z> I am talking about the cases when people need to run indexing as a backend
process - in my situation, we don't want to tie the flow of the contents
updating with the index updating. We created a backend process which monitors
the changes and does the indexing. The point I am trying to make is that when
you do the integration, you may need to take this into account - you should not
create threads from your servlet and/or EJB code (this is well-known), instead,
you may need to be able to start a separate process somehow to do the backend
or multiple threading job. You can use application server (Jboss , WebLogic, or
WebSphere) specific "startup" class, or you may use JMX. This is not Lucene
specific.
> We ended using JMX but the multi-threaded code for updating Lucene
> index can get ugly sometimes.
It should be as straightforward as sharing a single IndexWriter
instance.
<Z> In my situation, we have built multiple indexes and all of the contents
need to be updated frequently.
Literally updating a document in a Lucene index, however, is what can
be a bit confusing. Lucene doesn't have an "update" function - you
must remove and re-add a document to effectively update it. However
Lucene supports incremental indexing very nicely, which is something
many other search engines do not.
<Z> This is the type of "update" which I am talking about. I remembered that I
got a table of rules that discuss which operations are safe when you do such as
"delete" and "re-insert".
> Things may be getting better for the newer version of the Lucene.
Nothing related to the points you've brought up has changed with Lucene.
Erik
_______________________________________________
Juglist mailing list
[EMAIL PROTECTED] http://trijug.org/mailman/listinfo/juglist_trijug.org
_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org