Argh, sorry my mistake. Yes, IW.getReader() sees the existing index when open with create=false. An
-----Original Message----- From: Michael McCandless [mailto:luc...@mikemccandless.com] Sent: Thursday, January 07, 2010 11:10 AM To: java-dev@lucene.apache.org Subject: Re: IndexWriter.getReader() for existing index content Hmm, IW.getReader normally does include the existing index. Ie, if you open an IndexWriter with "create=false" on an existing index, and then call getReader(), the returned reader will search that full index. Is this not what you're seeing? Mike On Thu, Jan 7, 2010 at 1:58 PM, An Hong <an.h...@i365.com> wrote: > I've a requirement that when creating an IndexWriter on an existing index, I > need its getReader() to see the existing content. I've modified getReader() > to on its first call to invoke a modified version of addIndexesNoOptimized() > that does not check for dupDirs. It seems to work. Subsequent > addDocument() calls and reopen() of the reader also seem to work correctly. > This is with 2.9.1. > > > > I wonder if there's a problem with what I'm doing, or if there's a better > way? > > Thanks, > > An Hong > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org