Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8441

Wrong index sort field type throws unexpected NullPointerException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.5, 8.0
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      I came across this scary exception if you pass the wrong SortField.Type for a field; I'll attach patch w/ small test case:

      1) testWrongSortFieldType(org.apache.lucene.index.TestIndexSorting)
      java.lang.NullPointerException
              at __randomizedtesting.SeedInfo.seed([995FF58C7B184E8F:B0CC507647B2ED95]:0)
              at org.apache.lucene.index.SortingTermVectorsConsumer.abort(SortingTermVectorsConsumer.java:87)
              at org.apache.lucene.index.TermsHash.abort(TermsHash.java:68)
              at org.apache.lucene.index.DefaultIndexingChain.abort(DefaultIndexingChain.java:332)
              at org.apache.lucene.index.DocumentsWriterPerThread.abort(DocumentsWriterPerThread.java:138)
              at org.apache.lucene.index.DocumentsWriterPerThread.maybeAbort(DocumentsWriterPerThread.java:532)
              at org.apache.lucene.index.DocumentsWriterPerThread.flush(DocumentsWriterPerThread.java:524)
              at org.apache.lucene.index.DocumentsWriter.doFlush(DocumentsWriter.java:554)
              at org.apache.lucene.index.DocumentsWriter.flushAllThreads(DocumentsWriter.java:719)
              at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:3201)
              at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:3446)
              at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3411)
              at org.apache.lucene.index.TestIndexSorting.testWrongSortFieldType(TestIndexSorting.java:2489)
      

        Attachments

        1. LUCENE-8441.patch
          1 kB
          Michael McCandless
        2. LUCENE-8441.patch
          8 kB
          Jim Ferenczi

          Activity

            People

            • Assignee:
              mikemccand Michael McCandless
              Reporter:
              mikemccand Michael McCandless
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: