jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Thompson <elephant...@gmail.com>
Subject Re: Jackrabbit/SQL query
Date Wed, 28 Mar 2007 11:57:12 GMT
Thanks for the hints, Shaun.  I'll take another look at the spec.

My repository has the following structure:



where rootFolder is the root of a folder structure for storing files in 
the repository, separated by site.

My goal is search for files within one site but not another, e.g. SELECT 
* FROM my:type WHERE (site = 'mySite').  Using something like what 
you've described should be quite helpful.

Thanks again,


Shaun Barriball wrote:
> Hi Brian,
> We use the following:
> "SELECT * FROM my:type WHERE jcr:path LIKE '" + rootPath + "'"
> Where rootPath is a variable containing wildcards say "/home/%".
> Your query implies your intention may be to look for instances of the type
> ANYWHERE in the tree where the exist in a certain named folder e.g. "foo"
> where you may have:
> /foo
> /bar/foo
> /bar/bar/foo
> If so then the query above may be inappropriate as I'm not sure you can use
> wildcards 'within' the path e.g. "/%/home/%". I suggest referring to the
> "Path Constraint" section ( in the spec.
> Regards,
> Shaun.
> -----Original Message-----
> From: Brian Thompson [mailto:elephantium@gmail.com] 
> Sent: 27 March 2007 21:58
> To: users@jackrabbit.apache.org
> Subject: Jackrabbit/SQL query
> Inspired by
> http://diningtablecoder.blogspot.com/2006/11/using-lucene-syntax-in-jackrabb
> it-sql.html,
> I'm trying to write a query that only searches for nodes of a certain type
> within a particular subtree in my repository.  Unfortunately, the following
> query (my first attempt) returns no results:
> SELECT * FROM my:type WHERE contains(jcr:path, '"nodeName"')
> Note that the characters around nodeName are a single quote, then a double
> quote on the left and a double quote, then a single quote on the right.
> Does anyone have an idea of what I'm doing wrong?
> Thanks,
> -Brian
> ___________________________________________________________ 
> The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet
provider. http://uk.docs.yahoo.com/nowyoucan.html

View raw message