Skip to content

Apache Lucene open-source search software

LUCENE-5466: query is always null in countDocsWithClass() of SimpleNaiveBayesClassifier.

Koji Sekiguchi173daaedefe8
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 0654aefe90e..04e88433691 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -103,6 +103,9 @@ Bug fixes
* LUCENE-5432: EliasFanoDocIdSet: Fix number of index entry bits when the maximum
entry is a power of 2. (Paul Elschot via Adrien Grand)
+* LUCENE-5466: query is always null in countDocsWithClass() of SimpleNaiveBayesClassifier.
+ (Koji Sekiguchi)
+
Test Framework
* LUCENE-5449: Rename _TestUtil and _TestHelper to remove the leading _.
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
index 923f695852a..f039e70f844 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
@@ -88,8 +88,8 @@ public class SimpleNaiveBayesClassifier implements Classifier<BytesRef> {
this.textFieldNames = textFieldNames;
this.classFieldName = classFieldName;
this.analyzer = analyzer;
- this.docsWithClassSize = countDocsWithClass();
this.query = query;
+ this.docsWithClassSize = countDocsWithClass();
}
private int countDocsWithClass() throws IOException {