From db1f4a81a768154e4161a0760117920f1108dd05 Mon Sep 17 00:00:00 2001 From: Timothy Potter Date: Wed, 29 Jul 2015 19:45:47 +0000 Subject: [PATCH] SOLR-6357: Allow delete documents by doing a score join query. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1693338 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 2 ++ .../apache/solr/search/join/TestScoreJoinQPScore.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index d714568088b..af64767036d 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -253,6 +253,8 @@ Bug Fixes * SOLR-7842: ZK connection loss or session expiry events should not fire config directory listeners. (noble, shalin) +* SOLR-6357: Allow delete documents by doing a score join query. (Mikhail Khludnev, Timothy Potter) + Optimizations ---------------------- diff --git a/solr/core/src/test/org/apache/solr/search/join/TestScoreJoinQPScore.java b/solr/core/src/test/org/apache/solr/search/join/TestScoreJoinQPScore.java index 85fc86d6f2e..1692b0c72d8 100644 --- a/solr/core/src/test/org/apache/solr/search/join/TestScoreJoinQPScore.java +++ b/solr/core/src/test/org/apache/solr/search/join/TestScoreJoinQPScore.java @@ -115,6 +115,15 @@ public class TestScoreJoinQPScore extends SolrTestCaseJ4 { dir.close();*/ } + public void testDeleteByScoreJoinQuery() throws Exception { + indexDataForScorring(); + String joinQuery = "{!join from=" + toField + " to=" + idField + " score=Max}title:random"; + assertJQ(req("q", joinQuery, "fl", "id"), "/response=={'numFound':2,'start':0,'docs':[{'id':'1'},{'id':'4'}]}"); + assertU(delQ(joinQuery)); + assertU(commit()); + assertJQ(req("q", joinQuery, "fl", "id"), "/response=={'numFound':0,'start':0,'docs':[]}"); + } + public void testSimpleWithScoring() throws Exception { indexDataForScorring();