Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-7776: change javadocs default mention from Classic to BM25

Christine Poerschke5c5254341e41
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
index 6ed51e0bc04..f0391f4471d 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
@@ -86,7 +86,7 @@ public class KNearestNeighborClassifier implements Classifier<BytesRef> {
* @param indexReader the reader on the index to be used for classification
* @param analyzer an {@link Analyzer} used to analyze unseen text
* @param similarity the {@link Similarity} to be used by the underlying {@link IndexSearcher} or {@code null}
- * (defaults to {@link org.apache.lucene.search.similarities.ClassicSimilarity})
+ * (defaults to {@link org.apache.lucene.search.similarities.BM25Similarity})
* @param query a {@link Query} to eventually filter the docs used for training the classifier, or {@code null}
* if all the indexed docs should be used
* @param k the no. of docs to select in the MLT results to find the nearest neighbor
@@ -127,6 +127,9 @@ public class KNearestNeighborClassifier implements Classifier<BytesRef> {
return classifyFromTopDocs(knnSearch(text));
}
+ /**
+ * TODO
+ */
protected ClassificationResult<BytesRef> classifyFromTopDocs(TopDocs knnResults) throws IOException {
List<ClassificationResult<BytesRef>> assignedClasses = buildListFromTopDocs(knnResults);
ClassificationResult<BytesRef> assignedClass = null;
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/document/KNearestNeighborDocumentClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/document/KNearestNeighborDocumentClassifier.java
index adcb13b6a27..88d41fcd8d2 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/document/KNearestNeighborDocumentClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/document/KNearestNeighborDocumentClassifier.java
@@ -56,7 +56,7 @@ public class KNearestNeighborDocumentClassifier extends KNearestNeighborClassifi
*
* @param indexReader the reader on the index to be used for classification
* @param similarity the {@link Similarity} to be used by the underlying {@link IndexSearcher} or {@code null}
- * (defaults to {@link org.apache.lucene.search.similarities.ClassicSimilarity})
+ * (defaults to {@link org.apache.lucene.search.similarities.BM25Similarity})
* @param query a {@link org.apache.lucene.search.Query} to eventually filter the docs used for training the classifier, or {@code null}
* if all the indexed docs should be used
* @param k the no. of docs to select in the MLT results to find the nearest neighbor