iverase commented on a change in pull request #1866: URL: https://github.com/apache/lucene-solr/pull/1866#discussion_r489407818
########## File path: lucene/core/src/java/org/apache/lucene/document/ShapeQuery.java ########## @@ -265,10 +265,20 @@ private Scorer getSparseScorer(final LeafReader reader, final Weight weight, fin final DocIdSetIterator iterator = new BitSetIterator(result, cost[0]); return new ConstantScoreScorer(weight, boost, scoreMode, iterator); } - final DocIdSetBuilder docIdSetBuilder = new DocIdSetBuilder(reader.maxDoc(), values, query.getField()); - values.intersect(getSparseVisitor(query, docIdSetBuilder)); - final DocIdSetIterator iterator = docIdSetBuilder.build().iterator(); - return new ConstantScoreScorer(weight, boost, scoreMode, iterator); + if (values.getDocCount() << 2 < values.size()) { Review comment: indeed that is safer ---------------------------------------------------------------- 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. 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