arup-chauhan opened a new pull request, #4139:
URL: https://github.com/apache/solr/pull/4139
## Description
This PR fixes parents.preFilter handling in Solr’s nested-vector knn
parser as an incremental change for SOLR-18039.
Scope is intentionally limited to parser behavior and focused tests to
keep risk low.
Default behavior is unchanged for single `parents.preFilter`, this PR adds
correct support for repeated `parents.preFilter` values.
## Changes
- Updated `KnnQParser` to read `parents.preFilter` as multi-valued:
- from `localParams.get(PARENTS_PRE_FILTER)`
- to `localParams.getParams(PARENTS_PRE_FILTER)`
- Updated parent-filter parsing to handle each value as a filter subquery:
- create subquery parser per value
- call `setIsFilter(true)`
- include non-null queries as `BooleanClause.Occur.FILTER`
- Kept diversification behavior unchanged otherwise (`childrenOf`
requirement and downstream query construction remain the same).
- Added a focused regression test in `BlockJoinNestedVectorsQParserTest`:
-
`parentRetrievalFloat_knnChildrenWithMultipleParentFilters_shouldReturnKnnParents`
- verifies repeated `parents.preFilter` values are applied together
(intersection behavior).
## Validation
- .`/gradlew -p solr/core test --tests
org.apache.solr.search.join.BlockJoinNestedVectorsQParserTest --tests
org.apache.solr.search.join.BlockJoinNestedVectorsParentQParserTest`
- `./gradlew tidy`
- `./gradlew check -x test`
--
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]