SOLR-13336: fix CloudInspectUtil to use filter to eliminate risk of TooManyClausesException

This commit is contained in:
Chris Hostetter 2019-04-19 10:59:53 -07:00
parent 9f644b1c69
commit 1c3d23e58a
1 changed files with 5 additions and 2 deletions

View File

@ -209,12 +209,15 @@ public class CloudInspectUtil {
try {
// get versions for the mismatched ids
boolean foundId = false;
StringBuilder ids = new StringBuilder("id:(");
// use filter() to allow being parsed as 'terms in set' query instead of a (weighted/scored)
// BooleanQuery so we don't trip too many boolean clauses
StringBuilder ids = new StringBuilder("filter(id:(");
for (Map doc : differences) {
ids.append(" ").append(doc.get("id"));
foundId = true;
}
ids.append(")");
ids.append("))");
if (foundId) {
// get versions for those ids that don't match