vismaytiwari commented on issue #16134:
URL: https://github.com/apache/lucene/issues/16134#issuecomment-4927795817

   Hi! I was able to reproduce this on current `main` and opened a draft PR 
with a small fix: https://github.com/apache/lucene/pull/16382
   
   The issue happens because consecutive unescaped `*` wildcards are converted 
into separate `Automata.makeAnyString()` automata before concatenation. The PR 
collapses consecutive unescaped `*` tokens while preserving escaped `\*` as a 
literal.
   
   Locally, `WildcardQuery.toAutomaton(new Term("field", "*".repeat(10000)))` 
went from building `50,005,000` transitions to building `1` transition. I also 
added a regression test and verified it with `TestWildcardQuery` and 
`:lucene:core:check`.
   


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