lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Merging (adding) indices
Date Mon, 27 May 2002 22:41:04 GMT
The source code looks like this:

  public final synchronized void addIndexes(Directory[] dirs)
      throws IOException {
    optimize();                                   // start with zero or
1 seg
    for (int i = 0; i < dirs.length; i++) {
      SegmentInfos sis = new SegmentInfos();      // read infos from
dir
      sis.read(dirs[i]);
      for (int j = 0; j < sis.size(); j++) {
        segmentInfos.addElement(sis.info(j));     // add each info
      }
    }
    optimize();                                   // final cleanup
  }

So I think the original directories/indices should not be modified in
any way.  Are you sure your application is not deleting them?

Otis



--- Lex Lawrence <lex_lawrence@hotmail.com> wrote:
> Hello-
> I am using org.apache.lucene.index.IndexWriter.addIndexes(Directory[]
> dirs) 
> to merge several indices into one.  The resulting index appears to
> work 
> fine, but afterward the original indices seem to have been completely
> 
> emptied.
> 
> I can deal with that, but I just wanted to check: Is this method
> supposed to 
> alter the indices in the 'dirs' parameter?  It's not mentioned in the
> 
> javadoc.
> 
> Thanks- Lex
> 
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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


Mime
View raw message