Using prefixQuery to speedup wildcardQuery®expQuery in wildcard type when no TermQuery is present - #22510
Conversation
…pe when no TermQuery is present Signed-off-by: kkewwei <kewei.11@bytedance.com> Signed-off-by: kkewwei <kkewwei@163.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22510 +/- ##
============================================
+ Coverage 73.46% 73.50% +0.04%
- Complexity 76477 76503 +26
============================================
Files 6104 6104
Lines 346568 346596 +28
Branches 49883 49897 +14
============================================
+ Hits 254598 254767 +169
+ Misses 71693 71546 -147
- Partials 20277 20283 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@msfroh Would you mind take a look in your spare time? |
msfroh
left a comment
There was a problem hiding this comment.
While it's outside of the scope of this issue, the PrefixQuery instances that get returned don't specify a RewriteMethod (but neither does the pre-existing caseInsensitiveTermQuery).
I can think of a potential edge case where a* still matches a lot of terms. If we assume non-ASCII characters, it can theoretically be as much as 2^32. At that point, we would potentially be better off using a pure DV query, if there's a cheaper lead iterator. Of course, there's some existing Lucene work being done around improving the logic there. (Specifically, I need to get back to apache/lucene#16240. Thanks to this issue, I think I might see some opportunity around prefix queries in particular.)
Description
[Describe what this change achieves]
Related Issues
Resolves #22471
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.