Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 70902 invoked from network); 31 Mar 2008 18:54:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Mar 2008 18:54:03 -0000 Received: (qmail 52744 invoked by uid 500); 31 Mar 2008 18:54:01 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 52722 invoked by uid 500); 31 Mar 2008 18:54:01 -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 52713 invoked by uid 99); 31 Mar 2008 18:54:01 -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:54:01 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of alessandro.bologna@gmail.com designates 209.85.200.168 as permitted sender) Received: from [209.85.200.168] (HELO wf-out-1314.google.com) (209.85.200.168) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2008 18:53:18 +0000 Received: by wf-out-1314.google.com with SMTP id 23so1903803wfg.13 for ; Mon, 31 Mar 2008 11:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=B+0y/G1fhLB648EXkAdn6CdIoCvHnOkdj5cWGpAchLQ=; b=REjUl7CTT40QIjNMVChhiFNJyOJeZcDrateS0vA/VGppr79EzTPQinzYjkxZyZBrGAwPTLDwIsINnFfPomqwm0OZd3StvUQ9isMDyPTQPtRgiho5gcaXMWzVE7K0pjXbzIRR90vL/KMTnONEJrzjV/9uYJU9BcJsHSbMZN6C76U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=HpZmzSQ1f84IQVGQMzas6QTB6d7f9QsVwwNMIpxkq0QzHGO3BzeKo0LZxol/0Xidwo9JmWiJH8QkXj5wBw54s7+v6EsTijdRcSIrxUrq05P6zZYpt1Zoy9yQsEq4Mccmuog7UvshSNiXqv2mLKIk1GYsETe9WqlaZxA8s3eR4jg= Received: by 10.142.12.14 with SMTP id 14mr4138604wfl.152.1206989610120; Mon, 31 Mar 2008 11:53:30 -0700 (PDT) Received: by 10.142.132.17 with HTTP; Mon, 31 Mar 2008 11:53:30 -0700 (PDT) Message-ID: <29a095670803311153x10f32481r2e18f3f899b26f68@mail.gmail.com> Date: Mon, 31 Mar 2008 14:53:30 -0400 From: "Alessandro Bologna" To: users@jackrabbit.apache.org Subject: Re: Create search index for a node and its subtree In-Reply-To: <16397794.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16328_25684736.1206989610133" References: <16361535.post@talk.nabble.com> <29a095670803310453j49ca2cf7v5e364b4662f7b9e6@mail.gmail.com> <16397794.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_16328_25684736.1206989610133 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline sorry, I made a typo.. it's jcr:root, not jcr-root. And you can even just try //Folder-1//element(*,nt:file) etc etc.. Alessandro On Mon, Mar 31, 2008 at 2:01 PM, Sushil Vegad wrote: > > 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. > > ------=_Part_16328_25684736.1206989610133--