Fix segment-specific TermInSetQuery rewrites thrashing caching policy
Description
Fixes https://github.com/apache/lucene/issues/14986.
A TermInSetQuery with rewriteMethod = MultiTermQuery.CONSTANT_SCORE_BLENDED_REWRITE creates a RewritingWeight. Getting a scorer from this RewritingWeight for a segment could involve rewriting to a BooleanQuery of multiple TermQuery with only the terms present in that particular segment.
These segment-specific BooleanQuery rewrites all thrash the UsageTrackingQueryCachingPolicy ring buffer, which is shared across all segments of the index. The expectation is that we mark a query only once per shard in this ring buffer - ref
In this change: When initializing AbstractMultiTermQueryConstantScoreWrapper.RewritingWeight, we copy the supplied indexSearcher but with setQueryCache(null) and pass it along for the segment-specific rewrites. The subsequent rewrites into BooleanQuery of TermQuery don't go through the query cache (The idea is that these should be cached as the parent TermInSet query itself)
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!