lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Armbrust, Daniel C." <Armbrust.Dan...@mayo.edu>
Subject RE: Merging (adding) indices
Date Tue, 28 May 2002 12:51:55 GMT
I have also had the indexes that I merged disappear when I was merging
indexes.  It seems to happen nearly 100% of the time, when merging more than
2 indexes.  I just thought it was the normal behavior.  However, when I
merge only 2 indexes, they usually don't get deleted.  I don't have any code
that deletes the indexes on mergeing.  Maybe I should look closer at some
code if this isn't supposed to be happening?

Dan





-----Original Message-----
From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
Sent: Monday, May 27, 2002 5:41 PM
To: Lucene Users List
Subject: Re: Merging (adding) indices


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>

--
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