Skip to content

Conversation

@alessandrobenedetti
Copy link
Contributor

@alessandrobenedetti alessandrobenedetti commented Jan 15, 2026

https://issues.apache.org/jira/browse/SOLR-18074

Description

The scope of this pull request is to give users the possibility of handling multivalued vectors in Solr documents both at indexing and query time:

  • indexing time treating them as other multivalued fields
  • query time to return them in the results as other multivalued fields

Solution

It is implemented using behind the scenes nested documents:

  1. at indexing time the JSON in input is parsed and translated into nested vector documents in a pseudofield: "nested_vectors"

  2. at query time the child transformer allow to return only the best child (flat) or all children (flat)

Tests

Tests have been added to cover the major scenarios

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

# Conflicts:
#	solr/core/src/java/org/apache/solr/schema/DenseVectorField.java
#	solr/core/src/java/org/apache/solr/search/neural/KnnQParser.java
#	solr/core/src/test-files/solr/collection1/conf/schema-densevector.xml
#	solr/core/src/test/org/apache/solr/search/vector/KnnQParserMultiValuedVectorsTest.java
# Conflicts:
#	solr/core/src/java/org/apache/solr/search/vector/KnnQParser.java
#	solr/core/src/test-files/solr/collection1/conf/schema-densevector.xml
#	solr/core/src/test/org/apache/solr/search/vector/KnnQParserChildTest.java
#	solr/solr-ref-guide/modules/query-guide/pages/searching-nested-documents.adoc
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:index cat:schema cat:search documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant