lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject lucene-solr:master: LUCENE-7591 - approximate to no. of terms when DVs are not available
Date Mon, 12 Dec 2016 09:00:36 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 25c7855bb -> 87d8b5450


LUCENE-7591 - approximate to no. of terms when DVs are not available


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/87d8b545
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/87d8b545
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/87d8b545

Branch: refs/heads/master
Commit: 87d8b5450a6d75fdd4b724b24a3722054b6d00f8
Parents: 25c7855
Author: Tommaso Teofili <tommaso@apache.org>
Authored: Mon Dec 12 10:00:21 2016 +0100
Committer: Tommaso Teofili <tommaso@apache.org>
Committed: Mon Dec 12 10:00:21 2016 +0100

----------------------------------------------------------------------
 .../org/apache/lucene/classification/utils/DatasetSplitter.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/87d8b545/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
b/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
index 8bb0b1d..7ab674e 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/utils/DatasetSplitter.java
@@ -94,7 +94,8 @@ public class DatasetSplitter {
         }
       }
       if (classValues == null) {
-        throw new IllegalStateException("field \"" + classFieldName + "\" must have sorted
(set) doc values");
+        // approximate with no. of terms
+        noOfClasses += leave.reader().terms(classFieldName).size();
       }
       noOfClasses += valueCount;
     }


Mime
View raw message