Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 35763 invoked from network); 31 Mar 2008 18:02:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Mar 2008 18:02:22 -0000 Received: (qmail 81961 invoked by uid 500); 31 Mar 2008 18:02:21 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 81522 invoked by uid 500); 31 Mar 2008 18:02:20 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 81509 invoked by uid 99); 31 Mar 2008 18:02:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2008 11:02:20 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2008 18:01:38 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JgOKM-00042v-EC for users@jackrabbit.apache.org; Mon, 31 Mar 2008 11:01:50 -0700 Message-ID: <16397794.post@talk.nabble.com> Date: Mon, 31 Mar 2008 11:01:50 -0700 (PDT) From: Sushil Vegad To: users@jackrabbit.apache.org Subject: Re: Create search index for a node and its subtree In-Reply-To: <29a095670803310453j49ca2cf7v5e364b4662f7b9e6@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: vsushil@serebrum.com References: <16361535.post@talk.nabble.com> <29a095670803310453j49ca2cf7v5e364b4662f7b9e6@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Alessandro, Thanks for your reply. If I can restrict search results using path expression, I dont need separate indexes. In our application, these top level folders are accessed by users via permissions, so we were thinkng separate indexes. > /jcr-root/Folder-1//element(*,nt:base)[jcr:contains(.,'test')] which will > return only matches in Folder-1 > I tried the query you suggested, it didnt work. It would not return any result - is it because of the structure we are using? In my example below all folders (and child folders) are of the type 'nt:MyFolder' that extends nt:folder. All files under such folders are of type 'nt:MyFile' that extends nt:file. I tried the query /jcr-root/Folder-1//element(*,nt:file)[jcr:contains(jcr:content, '" + searchStr + "')]/rep:excerpt(.) It returns no results. This one does: //element(*,nt:file)[jcr:contains(jcr:content, '" + searchStr + "')]/rep:excerpt(.) Any thoughts please? Thanks, Sushil Alessandro Bologna wrote: > > Sushil, > from your message seems like you are just asking how to do queries by > path, > which is something that JCR supports very well (both XPATH and SQL > syntax): > say that your search expression is: > > //element(*,nt:base)[jcr:contains(.,'test')] > > then your search restricted to one of the paths below is: > > /jcr-root/Folder-1//element(*,nt:base)[jcr:contains(.,'test')] which will > return only matches in Folder-1 > > Alessandro > > > > On Fri, Mar 28, 2008 at 4:41 PM, Sushil Vegad > wrote: > >> >> Hello, >> Am a newbie to jackrabbit. >> >> Within a workspace, is it is possible to have a search index for a >> selected >> folder/node and its entire sub-tree? For example, the tree structure has >> the workspace node at the top >> >> Workspace >> Folder-1 (Child-1.1, Child-1.2, Child-1.3 etc) >> Folder-2 (Child-2.1, Child-2.2, Child-2.3 etc) >> Folder-3 >> >> etc >> >> We need a separate index for Folder-1 (and sub tree), lets say index-1. >> When >> index-1 is searched, it only searches folder-1 and its children. Likewise >> for Folder-2 (and sub tree), etc. The top level folders on which the >> index >> needs to be defined will always be directly under the workspace. They >> will >> never be nested >> >> Thanks, >> Sushil >> >> -- >> View this message in context: >> http://www.nabble.com/Create-search-index-for-a-node-and-its-subtree-tp16361535p16361535.html >> Sent from the Jackrabbit - Users mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Create-search-index-for-a-node-and-its-subtree-tp16361535p16397794.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.