msfroh commented on code in PR #13201: URL: https://github.com/apache/lucene/pull/13201#discussion_r1540109959
########## lucene/core/src/java/org/apache/lucene/search/AbstractMultiTermQueryConstantScoreWrapper.java: ########## @@ -292,7 +292,21 @@ public long cost() { }; } - private static long estimateCost(Terms terms, long queryTermsCount) throws IOException { + private static final int MAX_TERMS_TO_COUNT = 128; Review Comment: It's a great question! Maybe we could pass it as a constructor parameter, and the constant `RewriteMethod`s in `MultiTermQuery` could specify the default? I host a weekly OpenSearch Lucene Study Group on Zoom and we spent this week's meetup talking about this PR (and your issue): https://forum.opensearch.org/t/opensearch-lucene-study-group-meeting-monday-march-25th-2024/18547/3 There were some nice ideas that came up there around how to pick something better than an arbitrary limit -- like maybe using a time threshold instead. (But would that be a threshold per-clause?) -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org