Lucene - Core
  1. Lucene - Core
  2. LUCENE-5023

Only reader that contains fields can be added into readerContext

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Not A Problem
    • Affects Version/s: 4.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      When there is only Segements in solr core, which means no any indexes, in CompositeReaderContext.build() method, the atomicReader that has no fields returned should not be added into leaves. Otherwise, in SolrIndexSearcher.getDocSetNC(Query query, DocSet filter), when execute line fields.terms(t.field()), a nullpointerexception will occur since fields variable is null.

        Issue Links

          Activity

          Hide
          Uwe Schindler added a comment - - edited

          This is not a bug in ReaderContext. If an atomic reader has no fields it is perfectly fine to return null (it is documented like that). The bug is somewhere else in Solr or your own code. It must be listed in the reader context, as it may contain documents.

          Show
          Uwe Schindler added a comment - - edited This is not a bug in ReaderContext. If an atomic reader has no fields it is perfectly fine to return null (it is documented like that). The bug is somewhere else in Solr or your own code. It must be listed in the reader context, as it may contain documents.
          Hide
          Uwe Schindler added a comment -

          I opened SOLR-4877 to fix SolrIndexSearcher#getSocSetNC to correctly check for null fields().

          Show
          Uwe Schindler added a comment - I opened SOLR-4877 to fix SolrIndexSearcher#getSocSetNC to correctly check for null fields().
          Hide
          Uwe Schindler added a comment -

          The buggy code in SolrIndexSearcher was removed. Will be relaesed with 4.3.1 or 4.4

          Show
          Uwe Schindler added a comment - The buggy code in SolrIndexSearcher was removed. Will be relaesed with 4.3.1 or 4.4
          Hide
          Bao Yang Yang added a comment -

          thank you for your quick response, this is exactly what I mean.

          Show
          Bao Yang Yang added a comment - thank you for your quick response, this is exactly what I mean.

            People

            • Assignee:
              Uwe Schindler
              Reporter:
              Bao Yang Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development