Mailing List Archive

Indexing and Searching happening together
In the case where indexing takes a non-trivial amount of time, what is the expected behaviour when a search is performed while indexing is still going on?

Would it be a good solution to index in a temporary location, then copying the index files over to the final location when done?

Thanks..

Regards,
Kelvin Tan

Relevanz Pte Ltd
http://www.relevanz.com

180B Bencoolen St.
The Bencoolen, #04-01
S(189648)

Tel: 238 6229
Fax: 337 4417
Re: Indexing and Searching happening together [ In reply to ]
Kelvin,

>In the case where indexing takes a non-trivial amount of time, what is the expected behaviour when a search is performed while indexing is still going on?
>
>Would it be a good solution to index in a temporary location, then copying the index files over to the final location when done?

Have a look at:

http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg00133.html

>Thanks..
>
>Regards,
>Kelvin Tan
>
>Relevanz Pte Ltd
>http://www.relevanz.com
>
>180B Bencoolen St.
>The Bencoolen, #04-01
>S(189648)
>
>Tel: 238 6229
>Fax: 337 4417


--

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: Indexing and Searching happening together [ In reply to ]
> From: Kelvin Tan [mailto:kelvin@relevanz.com]
>
> In the case where indexing takes a non-trivial amount of
> time, what is the expected behaviour when a search is
> performed while indexing is still going on?

Once an IndexReader is open, no actions on an IndexWriter should affect it.
Adding documents in another thread or process will not affect search results
until a new IndexReader is opened. Searching and indexing may proceed
simultaneously.

Doug

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Indexing and Searching happening together [ In reply to ]
hmmmm...have read http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg00133.html

True (and it's great) that once an IndexReader is open, no actions on the IndexWriter affect it.

However, if an IndexReader is opened _after_ indexing begins, I suppose it'll throw an exception? Doesn't it mean that when indexing is taking place, the search engine is effectively down...

I suppose then, that if I still want to have the search engine up whilst indexing (where indexing takes a non-trivial amount of time), I'll have to index to a temporary location, then copy the index files over? Alternatively, I guess it's possible to open an IndexReader _before_ commencement of indexing and provide this instance of IndexReader to clients who need to search?

I just realized that I've effectively rephrased my initial question (and post). Perhaps it's the way I phrased my question (or that I'm missing something), but I don't seem to have gotten my query across initially...

Regards,
Kelvin
----- Original Message -----
From: Doug Cutting
To: 'Lucene Users List'
Sent: Friday, February 01, 2002 12:28 AM
Subject: RE: Indexing and Searching happening together


> From: Kelvin Tan [mailto:kelvin@relevanz.com]
>
> In the case where indexing takes a non-trivial amount of
> time, what is the expected behaviour when a search is
> performed while indexing is still going on?

Once an IndexReader is open, no actions on an IndexWriter should affect it.
Adding documents in another thread or process will not affect search results
until a new IndexReader is opened. Searching and indexing may proceed
simultaneously.

Doug

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: Indexing and Searching happening together [ In reply to ]
> From: Kelvin Tan [mailto:kelvin@relevanz.com]
>
> True (and it's great) that once an IndexReader is open, no
> actions on the IndexWriter affect it.
>
> However, if an IndexReader is opened _after_ indexing begins,
> I suppose it'll throw an exception? Doesn't it mean that when
> indexing is taking place, the search engine is effectively down...

No, an index is always searchable. It should be possible to open an
IndexReader at any time, and a coherent version of the index will be
available for search.

> I suppose then, that if I still want to have the search
> engine up whilst indexing (where indexing takes a non-trivial
> amount of time), I'll have to index to a temporary location,
> then copy the index files over?

No, that is not required.

> Alternatively, I guess it's
> possible to open an IndexReader _before_ commencement of
> indexing and provide this instance of IndexReader to clients
> who need to search?

This can be a useful technique if you are performing a number of coordinated
deletions and insertions to an index, and wish them all to appear at once.

Doug

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>