rquesada-tibco commented on code in PR #13201: URL: https://github.com/apache/lucene/pull/13201#discussion_r1539388204
########## 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; + + private long estimateCost(Terms terms, long queryTermsCount) throws IOException { + + // Try to explicitly compute the cost, but only if the term count is sufficiently small. + if (queryTermsCount < MAX_TERMS_TO_COUNT) { Review Comment: If queryTermsCount is unknown (i.e. -1), we'll also enter here, I guess this is intended, right? -- 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