dsmiley commented on code in PR #4700:
URL: https://github.com/apache/solr/pull/4700#discussion_r3712635110
##########
solr/core/src/test/org/apache/solr/schema/DenseVectorFieldTest.java:
##########
@@ -556,18 +556,36 @@ public void query_rangeSearch_shouldThrowException()
throws Exception {
}
}
- /** Not Supported */
@Test
- public void query_existenceSearch_shouldThrowException() throws Exception {
+ public void query_existenceSearch_shouldMatchDocumentsWithVector() throws
Exception {
try {
initCore("solrconfig-basic.xml", "schema-densevector.xml");
- assertQEx(
- "Running Existence queries on a dense vector field should raise an
Exception",
- "Range Queries are not supported for Dense Vector fields."
- + " Please use the {!knn} query parser to run K nearest
neighbors search queries.",
- req("q", "vector:[* TO *]", "fl", "vector"),
- SolrException.ErrorCode.BAD_REQUEST);
+ SolrInputDocument doc1 = new SolrInputDocument();
+ doc1.addField("id", "1");
+ doc1.addField("vector", Arrays.asList(1.0f, 2.0f, 3.0f, 4.0f));
Review Comment:
Use List.of instead
##########
solr/core/src/java/org/apache/solr/schema/DenseVectorField.java:
##########
@@ -572,6 +573,15 @@ public Query getKnnVectorQuery(
return baseQuery;
}
+ /**
+ * Dense vector fields index neither docValues nor norms usable for
existence checks, but Lucene
+ * exposes docs that contain a vector via {@link FieldExistsQuery}.
+ */
Review Comment:
honestly I'd drop the comment altogether. FEQ works; and is tested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]