lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Marius Kirsch <skir...@sebastian-kirsch.org>
Subject Re: managing docids for ParallelReader
Date Fri, 03 Jun 2005 13:36:20 GMT
Hi Doug,

I took up your suggestion to use a ParallelReader for adding more
fields to existing documents. I now have two indexes with the same
number of documents, but different fields. One field is duplicated
(the id field.)

I wrote a small class to merge those two indexes into one index; it is
attached to this message. However, when I run this class in order to
merge the two indexes, I get a NullPointerException:

Exception in thread "main" java.lang.NullPointerException
	at org.apache.lucene.index.ParallelReader$ParallelTermPositions.seek(ParallelReader.java:318)
	at org.apache.lucene.index.ParallelReader$ParallelTermDocs.seek(ParallelReader.java:294)
	at org.apache.lucene.index.SegmentMerger.appendPostings(SegmentMerger.java:325)
	at org.apache.lucene.index.SegmentMerger.mergeTermInfo(SegmentMerger.java:296)
	at org.apache.lucene.index.SegmentMerger.mergeTermInfos(SegmentMerger.java:270)
	at org.apache.lucene.index.SegmentMerger.mergeTerms(SegmentMerger.java:234)
	at org.apache.lucene.index.SegmentMerger.merge(SegmentMerger.java:96)
	at org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:596)
	at org.sebastiankirsch.thesis.util.ParallelIndexMergeTool.main(ParallelIndexMergeTool.java:27)

I'm afraid that this is my first journey into the bowels of Lucene,
and I don't know where to look for sources of the problem. I tried
removing the duplicate field, but the symptoms stay the same. Does
this mean that I cannot merge two indexes from a ParallelReader into
one normal? Or is it a problem with my index? Or a problem somewhere
else?

I am using revision 179785 from the svn repo.

Thanks very much for your time, Sebastian


	public static void main(String[] args) throws IOException {
		IndexWriter writer = new IndexWriter(args[0], new StandardAnalyzer(), true);
		ParallelReader reader = new ParallelReader();
		
		for (int i = 1; i < args.length; i++) {
			reader.add(IndexReader.open(args[i]));
		}
		
		writer.addIndexes(new IndexReader[] { reader });
		writer.optimize();
		writer.close();
	}

-- 
Sebastian Kirsch <skirsch@sebastian-kirsch.org> [http://www.sebastian-kirsch.org/]

NOTE: New email address! Please update your address book.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message