lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Marius Kirsch <>
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$
	at org.apache.lucene.index.ParallelReader$
	at org.apache.lucene.index.SegmentMerger.appendPostings(
	at org.apache.lucene.index.SegmentMerger.mergeTermInfo(
	at org.apache.lucene.index.SegmentMerger.mergeTermInfos(
	at org.apache.lucene.index.SegmentMerger.mergeTerms(
	at org.apache.lucene.index.SegmentMerger.merge(
	at org.apache.lucene.index.IndexWriter.addIndexes(
	at org.sebastiankirsch.thesis.util.ParallelIndexMergeTool.main(

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

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++) {
		writer.addIndexes(new IndexReader[] { reader });

Sebastian Kirsch <> []

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

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

View raw message