NestedDocsProvider.childDocs always returns all results. Regardless of the nested filter. Parent query works correctly, if the nested query has no results then the document is not returned. Nevertheless, the results that do not meet the filter condition are also taken for sorting.
{noformat} PredicateFinalStep filter = scope.predicate() .nested().objectField( "nested" ).nest( (f) -> { return f.match().field( "nested.active" ).matching( true ); } );
SearchQuery<DocumentReference> query = scope.query() .where( f -> { return f.bool().must( f.matchAll() ) .filter( filter ); } ) .sort( f -> f.field( "nested.additionalDoubleField" ).asc().multi().min() ) .toQuery(); {noformat} [https://github.com/hibernate/hibernate-search/pull/2224/commits/cba7041493eda3680fe00abfa107ba4af606496f#diff-74aab62c51304e2e914e81dd39c66236|https://github.com/hibernate/hibernate-search/pull/2224/commits/cba7041493eda3680fe00abfa107ba4af606496f#diff-74aab62c51304e2e914e81dd39c66236|smart-link] |
|