diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 5c79942b335..9bb7d24bbdb 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -256,6 +256,9 @@ Bug Fixes * SOLR-8145: Fix position of OOM killer script when starting Solr in the background (Jurian Broertjes via Timothy Potter) +* SOLR-8769: Fix document exclusion in mlt query parser in Cloud mode for schemas that have non-"id" + unique field (Erik Hatcher, Anshum Gupta) + Optimizations ---------------------- * SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been diff --git a/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java b/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java index 114226fe302..f2ed8b973a0 100644 --- a/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java +++ b/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java @@ -163,7 +163,7 @@ public class CloudMLTQParser extends QParser { BooleanQuery.Builder realMLTQuery = new BooleanQuery.Builder(); realMLTQuery.setDisableCoord(true); realMLTQuery.add(boostedMLTQuery, BooleanClause.Occur.MUST); - realMLTQuery.add(createIdQuery("id", id), BooleanClause.Occur.MUST_NOT); + realMLTQuery.add(createIdQuery(req.getSchema().getUniqueKeyField().getName(), id), BooleanClause.Occur.MUST_NOT); return realMLTQuery.build(); } catch (IOException e) {