From 173daaedefe894ac8a9295ebad309f5e7aa16165 Mon Sep 17 00:00:00 2001 From: Koji Sekiguchi Date: Fri, 28 Feb 2014 00:49:39 +0000 Subject: [PATCH] LUCENE-5466: query is always null in countDocsWithClass() of SimpleNaiveBayesClassifier. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1572793 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/CHANGES.txt | 3 +++ .../lucene/classification/SimpleNaiveBayesClassifier.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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 { this.textFieldNames = textFieldNames; this.classFieldName = classFieldName; this.analyzer = analyzer; - this.docsWithClassSize = countDocsWithClass(); this.query = query; + this.docsWithClassSize = countDocsWithClass(); } private int countDocsWithClass() throws IOException {