Return-Path: X-Original-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1863D1116C for ; Mon, 5 May 2014 08:44:13 +0000 (UTC) Received: (qmail 24387 invoked by uid 500); 5 May 2014 08:44:12 -0000 Delivered-To: apmail-jackrabbit-oak-commits-archive@jackrabbit.apache.org Received: (qmail 23201 invoked by uid 500); 5 May 2014 08:44:04 -0000 Mailing-List: contact oak-commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-commits@jackrabbit.apache.org Received: (qmail 23173 invoked by uid 99); 5 May 2014 08:44:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2014 08:44:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2014 08:44:00 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1201E23888D7; Mon, 5 May 2014 08:43:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1592468 - in /jackrabbit/oak/trunk/oak-solr-core/src: main/resources/solr/oak/conf/schema.xml test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultAnalyzersConfigurationTest.java test/resources/solr/oak/conf/schema.xml Date: Mon, 05 May 2014 08:43:39 -0000 To: oak-commits@jackrabbit.apache.org From: tommaso@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140505084340.1201E23888D7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tommaso Date: Mon May 5 08:43:39 2014 New Revision: 1592468 URL: http://svn.apache.org/r1592468 Log: OAK-1792 - fixed descendent_path type definition Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultAnalyzersConfigurationTest.java jackrabbit/oak/trunk/oak-solr-core/src/test/resources/solr/oak/conf/schema.xml Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml?rev=1592468&r1=1592467&r2=1592468&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml (original) +++ jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/schema.xml Mon May 5 08:43:39 2014 @@ -21,6 +21,8 @@ + + Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultAnalyzersConfigurationTest.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultAnalyzersConfigurationTest.java?rev=1592468&r1=1592467&r2=1592468&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultAnalyzersConfigurationTest.java (original) +++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/configuration/DefaultAnalyzersConfigurationTest.java Mon May 5 08:43:39 2014 @@ -25,7 +25,9 @@ import org.apache.lucene.analysis.TokenS import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.miscellaneous.LengthFilter; +import org.apache.lucene.analysis.miscellaneous.RemoveDuplicatesTokenFilter; import org.apache.lucene.analysis.path.PathHierarchyTokenizer; +import org.apache.lucene.analysis.pattern.PatternCaptureGroupTokenFilter; import org.apache.lucene.analysis.pattern.PatternReplaceFilter; import org.apache.lucene.analysis.reverse.ReverseStringFilter; import org.apache.lucene.util.LuceneTestCase; @@ -101,7 +103,9 @@ public class DefaultAnalyzersConfigurati @Override protected TokenStreamComponents createComponents(String fieldName, Reader reader) { Tokenizer source = new PathHierarchyTokenizer(reader); - return new TokenStreamComponents(source); + TokenStream filter = new PatternCaptureGroupTokenFilter(source, false, Pattern.compile("((\\/).*)")); + filter = new RemoveDuplicatesTokenFilter(filter); + return new TokenStreamComponents(source, filter); } }; this.allChildrenPathSearchingAnalyzer = new Analyzer() { @@ -117,7 +121,7 @@ public class DefaultAnalyzersConfigurati public void testAllChildrenIndexingTokenization() throws Exception { try { TokenStream ts = allChildrenPathIndexingAnalyzer.tokenStream("text", new StringReader("/jcr:a/jcr:b/c/jcr:d")); - assertTokenStreamContents(ts, new String[]{"/jcr:a", "/jcr:a/jcr:b", "/jcr:a/jcr:b/c", "/jcr:a/jcr:b/c/jcr:d"}); + assertTokenStreamContents(ts, new String[]{"/jcr:a", "/", "/jcr:a/jcr:b", "/jcr:a/jcr:b/c", "/jcr:a/jcr:b/c/jcr:d"}); } finally { allChildrenPathIndexingAnalyzer.close(); } @@ -191,13 +195,21 @@ public class DefaultAnalyzersConfigurati public void testAllChildrenPathMatching() throws Exception { String nodePath = "/jcr:a/jcr:b/c"; String descendantPath = nodePath + "/d/jcr:e"; - assertAnalyzesTo(allChildrenPathIndexingAnalyzer, descendantPath, new String[]{"/jcr:a", "/jcr:a/jcr:b", "/jcr:a/jcr:b/c", "/jcr:a/jcr:b/c/d", "/jcr:a/jcr:b/c/d/jcr:e"}); + assertAnalyzesTo(allChildrenPathIndexingAnalyzer, descendantPath, new String[]{"/jcr:a", "/", "/jcr:a/jcr:b", "/jcr:a/jcr:b/c", "/jcr:a/jcr:b/c/d", "/jcr:a/jcr:b/c/d/jcr:e"}); assertAnalyzesTo(allChildrenPathSearchingAnalyzer, nodePath, new String[]{nodePath}); assertAnalyzesTo(allChildrenPathSearchingAnalyzer, "/jcr:a", new String[]{"/jcr:a"}); assertAnalyzesTo(allChildrenPathSearchingAnalyzer, "/jcr:a/b", new String[]{"/jcr:a/b"}); assertAnalyzesTo(allChildrenPathSearchingAnalyzer, "/a/b/c", new String[]{"/a/b/c"}); assertAnalyzesTo(allChildrenPathSearchingAnalyzer, "/a/b/c/d", new String[]{"/a/b/c/d"}); assertAnalyzesTo(allChildrenPathSearchingAnalyzer, "/a/b/c/d/jcr:e", new String[]{"/a/b/c/d/jcr:e"}); + assertAnalyzesTo(allChildrenPathSearchingAnalyzer, "/", new String[]{"/"}); + } + + @Test + public void testAllChildrenPathMatchingOnRootNode() throws Exception { + String nodePath = "/"; + String descendantPath = nodePath + "jcr:a/jcr:b"; + assertAnalyzesTo(allChildrenPathIndexingAnalyzer, descendantPath, new String[]{"/jcr:a", "/", "/jcr:a/jcr:b"}); } @Test Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/resources/solr/oak/conf/schema.xml URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/resources/solr/oak/conf/schema.xml?rev=1592468&r1=1592467&r2=1592468&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-solr-core/src/test/resources/solr/oak/conf/schema.xml (original) +++ jackrabbit/oak/trunk/oak-solr-core/src/test/resources/solr/oak/conf/schema.xml Mon May 5 08:43:39 2014 @@ -21,6 +21,8 @@ + +