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

   🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
   
   https://issues.apache.org/jira/browse/SOLR-18624
   
   ## What happens today
   
   **`TestMultiWordSynonyms.testPf` is flaky because it expects a fixed order 
for documents with equal scores.** The `tropical cyclone foo` request expects 
document 10 first, although all four matches can have the same score. Its 
two-word phrase boosts are `tropical cyclone` and `cyclone foo`. The first 
matches every document through the synonym `bar`; the second matches none. 
Document 10 has no score advantage, so a change in index document order can 
fail the assertion.
   
   ## What this change does
   
   **The test checks scores and phrase boosts while allowing tied results in 
any order.** The initial requests must show that `bf=boost_d` changes scores, 
and the phrase requests must show that a close phrase match can outweigh that 
boost. For reversed `bar foo`, slop zero must leave documents 10 and 13 tied, 
while slop two must make document 10 score higher. The final request checks all 
four IDs and both expected phrase boosts without requiring document 10 first. 
[Test 
changes](https://github.com/nick-boss-tech/solr/blob/0af4f5b3f2784eba3693acdc33dc49f6c2802b6a/solr/core/src/test/org/apache/solr/search/TestMultiWordSynonyms.java#L93-L250).
   
   ## Proof
   
   <details>
   <summary>Linux verification at 
0af4f5b3f2784eba3693acdc33dc49f6c2802b6a</summary>
   
   Verified November 5, 2026, with JDK 21 and Gradle 9.7.0:
   
   - `TestMultiWordSynonyms.testPf`: 25/25 repetitions, seed `18624C0DE`.
   - Full `TestMultiWordSynonyms`: 6/6; neighboring 
`TestExtendedDismaxParser.testPfPs`: 1/1, seed `18624BEEF`. Both runs had no 
failures, errors or skips.
   - Tidy, Error Prone compilation and root `check -x test` passed. The working 
tree stayed clean. A stale Gradle lock was cleared before the successful tidy 
run and before any tests ran. The root check used a normal clone at the same 
SHA for Antora.
   - With `sort=score desc,id desc`, document 10 won for `bar foo`, while 
`tropical cyclone foo` tied and returned 13,12,11,10.
   - Three deliberately broken versions of the production query parser each 
compiled and failed the intended test assertion: dropping the reversed `bar 
foo` phrase, ignoring `bf`, and dropping the `cyclone foo` phrase. The tests 
were unchanged, and all temporary production changes were reverted.
   
   [Verification 
record](https://github.com/nick-boss-tech/solr/blob/264cd142a1768999988d2dea7324cde50b80b583/receipts/SOLR-18624-assertion-repair-round-2.md).
   
   </details>
   
   ## Limits
   
   **The original failing run could not be replayed because its seed was not 
recorded.** Only one test file changes; production behavior is unchanged.
   
   *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