nick-boss-tech opened a new pull request, #5229:
URL: https://github.com/apache/solr/pull/5229

   🤖 *AI text below* 🤖 *(reviewed by Nick Shanin)*
   
   https://issues.apache.org/jira/browse/SOLR-10928
   
   ## What happens today
   
   **QueryElevationComponent matches elevate.xml entries against the request's 
main query, so fielded or complex queries never elevate.**
   
   The component takes the text to match from the `q` parameter. A request like 
`q=brain` can match an entry in elevate.xml. A request like 
`q=indexingabstract:brain`, a nested query, or a complexphrase query cannot, 
because the whole query string is what gets matched. Elevation silently does 
not apply. Other components solved this long ago: spellcheck has `spellcheck.q` 
and highlighting has `hl.q`, so the client can state the exact text to use. 
QueryElevationComponent has no equivalent.
   
   ## What this change does
   
   **The change adds an `elevate.q` parameter that supplies the text to match 
against elevate.xml.**
   
   
[QueryElevationParams](https://github.com/nick-boss-tech/solr/blob/f2001e640a464e8e861ee3c202821b6dcc4bd497/solrj/src/java/org/apache/solr/common/params/QueryElevationParams.java)
 gains the `elevate.q` parameter name, and 
[QueryElevationComponent](https://github.com/nick-boss-tech/solr/blob/f2001e640a464e8e861ee3c202821b6dcc4bd497/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java)
 uses it for the elevate.xml lookup when it is present. When `elevate.q` is 
absent, matching uses the main query exactly as today, so existing requests are 
unaffected. The Reference Guide page for the component documents the new 
parameter.
   
   ## Proof
   
   **The new tests pass at this head in two full focused runs, and the standard 
checks are clean.**
   
   The parameter does not exist on the base code, so the new tests have nothing 
to exercise there. At head `f2001e640a464e8e861ee3c202821b6dcc4bd497`, verified 
2026-10-25: tidy clean with no tree changes, Error Prone compile clean, and 
`:solr:core:check -x test` passing. Focused runs at two seeds each: 
QueryElevationComponentTest 23/23, QueryElevationComponentParamTest 4/4, 
DistributedQueryElevationComponentTest 1/1, with zero failures and zero errors 
at both seeds.
   
   ## Limits
   
   The full `:solr:core:test` suite was not run; the focused classes above and 
the standard checks were. Matching is still an exact text lookup against 
elevate.xml entries: this change adds the alternate text source and does not 
parse or normalize the query. Distributed coverage is the one test method in 
DistributedQueryElevationComponentTest.
   
   Changelog: 
[changelog/unreleased/SOLR-10928-elevate-q.yml](https://github.com/nick-boss-tech/solr/blob/f2001e640a464e8e861ee3c202821b6dcc4bd497/changelog/unreleased/SOLR-10928-elevate-q.yml)
   
   *AI-generated description. Nick Shanin directed the work and takes 
responsibility for this contribution.*
   


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