lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <>
Subject Re: online and offline Directory
Date Tue, 28 Sep 2004 07:23:14 GMT
Ernesto De Santis writes:
> Hi Aviran
> Thanks for response.
> I forgot important information for you understand my issue.
> My process do some like this:
> The index have contents from differents sources, identified for a special
> field 'source'.
> Then the index have documents with source: S1 or source: S2 ... etc.
> When I reindex the source S1, first delete all documents with source: S1, in
> otherwise I have the index with repeated content. Then add the new index
> result.
> In the middle of process the IndexSearcher use an incomplete index.
> Is posible do it like a data base transaction?
It's not like a data base transcation but any index reader/searcher that
was opened before the changes won't see them until it's closed and reopened.
AFAIK that also applies to deletions though I never checked that.

So you have two options: a) use a second index for indexing, move the
indexes after the indexing is done and make sure indexreader/searcher
are closed and reopened after the move.
b) use one index and make sure that you do not open any index reader/searcher
during the update. Searches may only use already opened reader/searcher.

I guess it depends on index size, update frequency and so on, which 
szenario is easier to handle.
Given that the index isn't too large and update frequency is rather low, 
I'd use a second index. But you'll need to copy that index and should 
consider the time and disc IO needed for that.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message