vismaytiwari opened a new pull request, #16382:
URL: https://github.com/apache/lucene/pull/16382

   ### Description
   
   Fixes #16134.
   
   `WildcardQuery.toAutomaton` created a separate `Automata.makeAnyString()` 
automaton for every unescaped `*`. Consecutive `*` wildcards match the same 
language as a single `*`, but the repeated form made `Operations.concatenate` 
build a much larger automaton.
   
   This collapses consecutive unescaped `*` tokens while preserving escaped 
`\*` as a literal. It also adds a regression test that checks repeated 
asterisks produce the same automaton shape as a single asterisk.
   
   Before the change, `WildcardQuery.toAutomaton(new Term("field", 
"*".repeat(10000)))` built `50,005,000` transitions locally. After the change, 
the same input builds `1` transition.
   
   Validation:
   
   - `./gradlew tidy`
   - `./gradlew :lucene:core:test --tests TestWildcardQuery 
-Dtests.seed=5EEC297244EB01E6 -Dtests.asserts=true -Dtests.file.encoding=UTF-8`
   - `./gradlew :lucene:core:check -Dtests.seed=5EEC297244EB01E6 
-Dtests.asserts=true -Dtests.file.encoding=UTF-8`
   


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