shawdm opened a new pull request, #4442:
URL: https://github.com/apache/solr/pull/4442

   https://issues.apache.org/jira/browse/SOLR-18245
   
   
   # Description
   
   When using LTR, a client may need to know the sort score that a document 
would have required to have been eligible for rerank by LTR.
   
   # Solution
   
   This PR adds a `echoReRankCutoff` local parameter to the LTR rerank query 
(e.g. `{!ltr model=myModel reRankDocs=100 echoReRankCutoff=true}`. When this 
parameter is set to true, the `responseHeader` will include a `reRankCutoff` 
field which will return the score of the lowest ranked document that was 
included for rerank. When multiple sorts are used (e.g. `sort=price 
desc,discount asc`), the response header contains the cutoff value for each 
sort, in order.
   
   ## Example Response
   ```
   "responseHeader": {
     "status": 0,
     "QTime": 1,
     "reRankCutoff": [
       11.99,
       2.20
     ]
   }
   ```
   
   # Tests
   
   * Tests added to `TestLTRQParserPlugin` to test core functionality. 
   *  New test class `TestLTRReRankCutoffOnSolrCloud` added to test for sharded 
cases. This has also meant I've extracted out shared code from 
`TestLTROnSolrCloud` in to a common `AbstractLTRSolrCloudTestBase`.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [X] I have reviewed the guidelines for [How to 
Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my 
code conforms to the standards described there to the best of my ability.
   - [X] I have created a Jira issue and added the issue ID to my pull request 
title.
   - [ ] I have given Solr maintainers 
[access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
 to contribute to my PR branch. (optional but recommended, not available for 
branches on forks living under an organisation)
   - [X] I have developed this patch against the `main` branch.
   - [ ] I have run `./gradlew check`.
   - [X] I have added tests for my changes.
   - [X] I have added documentation for the [Reference 
Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   - [ ] I have added a [changelog 
entry](https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc) for my 
change
   


-- 
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]

Reply via email to