You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by an...@apache.org on 2016/03/04 00:42:44 UTC

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

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 638b14537 -> ba039f7c8


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


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ba039f7c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ba039f7c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ba039f7c

Branch: refs/heads/branch_6x
Commit: ba039f7c8c28518053776fe9952e5cb93c5b3f75
Parents: 638b145
Author: anshum <an...@apache.org>
Authored: Thu Mar 3 15:27:04 2016 -0800
Committer: anshum <an...@apache.org>
Committed: Thu Mar 3 15:42:00 2016 -0800

----------------------------------------------------------------------
 solr/CHANGES.txt                                                  | 3 +++
 .../core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ba039f7c/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 5c79942..9bb7d24 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

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ba039f7c/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java
----------------------------------------------------------------------
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 114226f..f2ed8b9 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) {