lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy" <>
Subject RE: [jira] Created: (LUCENENET-125) Lucene 2.3.1(a?) - Unhandled System.NullReferenceException In Lucene.Net.Index.DocumentsWriter.CompareText
Date Fri, 11 Jul 2008 20:00:03 GMT
I think this is the same bug as in .
Can you try the patch?


-----Original Message-----
From: Ken Katzgrau (JIRA) [] 
Sent: Thursday, July 10, 2008 8:03 PM
Subject: [jira] Created: (LUCENENET-125) Lucene 2.3.1(a?) - Unhandled System.NullReferenceException
In Lucene.Net.Index.DocumentsWriter.CompareText

Lucene 2.3.1(a?) - Unhandled System.NullReferenceException  In Lucene.Net.Index.DocumentsWriter.CompareText

                 Key: LUCENENET-125
             Project: Lucene.Net
          Issue Type: Bug
         Environment: Microsoft Visual Studio 2005, XP Pro
            Reporter: Ken Katzgrau

When creating a test index of a 1,000,000 documents, I encountered a null reference exception
originating from the document writer approximately every 80,000 documents. The code producing
this error is:

    class Program
        static void Main(string[] args)
            IndexWriter iw = new IndexWriter(@"C:\TestIndex", new WhitespaceAnalyzer(), true);
            Document d;
            Field f;

            for (int i = 0; i < 100000; i++)
                if (i % 10000 == 0) Console.WriteLine("Doc: " + i);

                d = new Document();

                f = new Field("Field1", "Content " + i, Field.Store.YES, Field.Index.UN_TOKENIZED);

                f = new Field("Field2", "Content " + i, Field.Store.YES, Field.Index.UN_TOKENIZED);

                iw.AddDocument(d); *Exception occurs here

            iw.Close(); *If the exception is caught, the IndexWriter iw becomes null

The exception is:

System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
       at Lucene.Net.Index.DocumentsWriter.CompareText(Char[] text1, Int32 pos1, Char[] text2,
Int32 pos2)
       at Lucene.Net.Index.DocumentsWriter.AppendPostings(FieldData[] fields, TermInfosWriter
termsOut, IndexOutput freqOut, IndexOutput proxOut)
       at Lucene.Net.Index.DocumentsWriter.WriteSegment()
       at Lucene.Net.Index.DocumentsWriter.Flush(Boolean closeDocStore)
       at Lucene.Net.Index.IndexWriter.DoFlush(Boolean flushDocStores)
       at Lucene.Net.Index.IndexWriter.Flush(Boolean triggerMerge, Boolean flushDocStores)
       at Lucene.Net.Index.IndexWriter.AddDocument(Document doc, Analyzer analyzer)
       at Lucene.Net.Index.IndexWriter.AddDocument(Document doc)
       -- Line Removed --
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity,
String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message