Skip to content

Conversation

@aruggero
Copy link
Contributor

@aruggero aruggero commented Sep 22, 2025

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

Description

Added the possibility to pass the Lucene filteredSearchThreshold parameter as a Solr Knn query parameter.

Solution

The parameter has been added to the KnnQParser class, and the getKnnVectorQuery method has been adapted to accept this parameter and call the appropriate KnnVectorQuery constructor in Lucene.

Tests

Two tests have been added in DenseVectorFieldTest to check that the getKnnVectorQuery method returns an object with the expected threshold set.

Two tests have been added in KnnQParserTest to check that the new filteredSearchThreshold parameter is correctly parsed and set.

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

…e/SOLR-17815

# 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/org/apache/solr/schema/DenseVectorFieldTest.java
#	solr/core/src/test/org/apache/solr/search/neural/KnnQParserTest.java
@aruggero aruggero marked this pull request as ready for review October 21, 2025 13:34
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 21, 2025
@alessandrobenedetti alessandrobenedetti merged commit 512e02a into apache:main Oct 21, 2025
2 of 3 checks passed
alessandrobenedetti pushed a commit that referenced this pull request Oct 21, 2025
alessandrobenedetti pushed a commit that referenced this pull request Oct 21, 2025
@aruggero aruggero deleted the feature/SOLR-17815 branch November 7, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants