SOLR-8769: Fix document exclusion in mlt query parser in Cloud mode for schemas that have non-'id' unique field

This commit is contained in:
anshum 2016-03-03 15:27:04 -08:00
parent 638b145376
commit ba039f7c8c
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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) {