lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer" <>
Subject Re: Gdata - opening/closing index
Date Sun, 23 Jul 2006 18:31:14 GMT
On 7/23/06, karl wettin <> wrote:
> On Sun, 2006-07-23 at 19:10 +0200, Simon Willnauer wrote:
> > So if I index every change immediately I have to open and close the
> > index reader and writer all the time. This is not very efficient.
> How often do you plan to close the readers and writers?

Well as less as possible but this depends on how frequently updates
e.g. modifications occur.
I would make the factor of closing the index configurable to enable
users to choose how many documents can be added to the index before
closing it. This could / should be combined with an idle time.

> You will find the code in directory /index of the tar-ball I attached to
> issue 550 earlier today. It is a big fat layer of facade and decorators,
> and you will have use NotifiableIndex.openWhatNot and
> AutofreshedSearcher.getSearcher instead of creating your own instances.
> I'm sure someone have a reason not to use this solution, but it works
> great for me.

This is a lot of code without comments or java doc but it seems quiet
useful for that purpose. I will have a look at your code to grab some
ideas out of it.
I needed a similar thing for the storage so I keep track of the
references for each Searcher and decrement the reference when I don't
need the searcher anymore. If the indexwriter has been closed the last
remaining reference is decremented otherwise there is at least one ref
remaining. So the searcher destroys itself if there is no reference to
it anymore.

regards Simon

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

View raw message