jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaun Barriball" <sbarr...@yahoo.co.uk>
Subject RE: Jackrabbit/SQL query
Date Wed, 28 Mar 2007 07:01:40 GMT
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 (6.6.3.4) 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

Mime
View raw message