Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-10836

TextLogisticRegression parser (and others) assume non-empty index.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.7, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      TextLogisticRegressionQParserPlugin, IGainTermsQParserPlugin and SignificantTermsQParserPlugin are similarly affected:

      finish() contains this line of code:

      Terms terms = MultiFields.getFields(searcher.getIndexReader()).terms(trainingParams.feature);
      

      Instead I think it should be this:

      Terms terms = ((SolrIndexSearcher)searcher).getSlowAtomicReader().terms(trainingParams.feature);
      

      MultiFields can take some time to build and Solr (via SlowAtomicReader) has already done this work.

      In addition, the code assumes Terms is non-null when in fact it will be null if there's no data.

        Attachments

          Activity

            People

            • Assignee:
              dsmiley David Smiley
              Reporter:
              dsmiley David Smiley
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: