This is an automated email from the ASF dual-hosted git repository.
cpoerschke pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new f8e408418d6 remove deprecated KnnVectorField use (#3121)
f8e408418d6 is described below
commit f8e408418d6767e0424c5c06e6d59ac4dc0fe3c8
Author: Christine Poerschke <[email protected]>
AuthorDate: Mon Feb 3 14:57:42 2025 +0000
remove deprecated KnnVectorField use (#3121)
Co-authored-by: Ishan Chattopadhyaya <[email protected]>
Co-authored-by: noblepaul <[email protected]>
(cherry picked from commit cc9a0f81b5a055073a33ffac18e29646be18e20b)
---
solr/core/src/java/org/apache/solr/schema/DenseVectorField.java | 6 ++++--
.../src/test/org/apache/solr/update/DocumentBuilderTest.java | 9 ++++-----
.../solr/update/DocumentBuilderVectorCatchAllCopyTest.java | 5 ++---
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java
b/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java
index 4d528361dd4..773c1e6337d 100644
--- a/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java
+++ b/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java
@@ -52,8 +52,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Provides a field type to support Lucene's {@link
org.apache.lucene.document.KnnVectorField}. See
- * {@link org.apache.lucene.search.KnnVectorQuery} for more details. It
supports a fixed cardinality
+ * Provides a field type to support Lucene's {@link
org.apache.lucene.document.KnnByteVectorField}
+ * and {@link org.apache.lucene.document.KnnFloatVectorField}. See {@link
+ * org.apache.lucene.search.KnnByteVectorQuery} and {@link
+ * org.apache.lucene.search.KnnFloatVectorQuery} for more details. It supports
a fixed cardinality
* dimension for the vector and a fixed similarity function. The default
similarity is
* EUCLIDEAN_HNSW (L2). The default algorithm is HNSW. For Lucene 9.1 e.g. See
{@link
* org.apache.lucene.util.hnsw.HnswGraph} for more details about the
implementation. <br>
diff --git a/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
b/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
index 3dd77cc1155..80ecd512e1c 100644
--- a/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
+++ b/solr/core/src/test/org/apache/solr/update/DocumentBuilderTest.java
@@ -26,7 +26,6 @@ import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.KnnFloatVectorField;
-import org.apache.lucene.document.KnnVectorField;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.index.VectorSimilarityFunction;
import org.apache.lucene.tests.util.TestUtil;
@@ -352,8 +351,8 @@ public class DocumentBuilderTest extends SolrTestCaseJ4 {
Document out = DocumentBuilder.toDocument(doc, core.getLatestSchema());
// from /solr/core/src/test-files/solr/collection1/conf/schema.xml
- KnnVectorField expectedIndexableField =
- new KnnVectorField(
+ KnnFloatVectorField expectedIndexableField =
+ new KnnFloatVectorField(
"vector", new float[] {1.1f, 2.1f, 3.1f, 4.1f},
VectorSimilarityFunction.COSINE);
assertThat(
@@ -383,8 +382,8 @@ public class DocumentBuilderTest extends SolrTestCaseJ4 {
Document out = DocumentBuilder.toDocument(doc, core.getLatestSchema());
// from /solr/core/src/test-files/solr/collection1/conf/schema.xml
- KnnVectorField expectedDestination =
- new KnnVectorField(
+ KnnFloatVectorField expectedDestination =
+ new KnnFloatVectorField(
"vector2", new float[] {1.1f, 2.1f, 3.1f, 4.1f},
VectorSimilarityFunction.DOT_PRODUCT);
assertThat(
diff --git
a/solr/core/src/test/org/apache/solr/update/DocumentBuilderVectorCatchAllCopyTest.java
b/solr/core/src/test/org/apache/solr/update/DocumentBuilderVectorCatchAllCopyTest.java
index cda41e76e0b..aa3b5af772f 100644
---
a/solr/core/src/test/org/apache/solr/update/DocumentBuilderVectorCatchAllCopyTest.java
+++
b/solr/core/src/test/org/apache/solr/update/DocumentBuilderVectorCatchAllCopyTest.java
@@ -24,7 +24,6 @@ import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.KnnFloatVectorField;
-import org.apache.lucene.document.KnnVectorField;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.index.VectorSimilarityFunction;
import org.apache.solr.SolrTestCaseJ4;
@@ -54,8 +53,8 @@ public class DocumentBuilderVectorCatchAllCopyTest extends
SolrTestCaseJ4 {
Document out = DocumentBuilder.toDocument(doc, core.getLatestSchema());
// from /solr/core/src/test-files/solr/collection1/conf/schema.xml
- KnnVectorField expectedDestination =
- new KnnVectorField(
+ KnnFloatVectorField expectedDestination =
+ new KnnFloatVectorField(
"vector2", new float[] {1.1f, 2.1f, 3.1f, 4.1f},
VectorSimilarityFunction.DOT_PRODUCT);
assertThat(