jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Kahwe Smith <...@pooteeweet.org>
Subject SQL2 (via davex)
Date Tue, 09 Aug 2011 14:17:58 GMT
Hi,

I am undergoing some frustrations with SQL2, which hopefully someone on this list can resolve.

I have a structure like follows

/issues
/issues/2011
/issues/2011/08
/issues/2011/08/09
/issues/2011/08/09/foo
/issues/2011/08/09/bar
/issues/2011/08/02
/issues/2011/08/02/foo
/issues/2011/08/02/bar

now I am trying to get a list of all the "dates"

aka fetch all nodes that match LIKE '/issues/____/__/__' (not sure if underscore is supported
in SQL)

I tried two approaches.

The first the obvious one just trying to match the PATH (note for now I hardcoded the 2011
and 08 but eventually I would want those to be place holders):

HTTP 400: Query:
SELECT * FROM [nt:unstructured] WHERE PATH()(*)LIKE '/issue/2011/08/%'; expected: LENGTH,
NAME, LOCALNAME, SCORE, LOWER, UPPER, or CAST

Passing  [nt:unstructured] to PATH() doesnt help. Nor does using jcr:path.

The other approach I tried was finding the node by matching the child nodes aka (/issues/2011/08/09/*)
using an INNER JOIN ON ISDECENDENTNODE() but that either got me no matches or a 403. Not sure
if I am getting the 403 if there are too many matches because if I remove certain conditions
the 403 happend if I left all relevant conditions in I got no result. But without the join
just looking without filters I get results, so I was pretty certain my queries worked.

Any tipps? I am also wondering if there are any tools that can help debug the internals of
whats going on inside Jackrabbit when sending SQL2 queries via davex.

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




Mime
View raw message