You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by hsp <pi...@ibest.com.br> on 2006/06/26 22:54:55 UTC

Searching with like over the path

Hi;
 I am doing a search in sql with the following:

"SELECT * FROM my:base WHERE jcr:path LIKE '/Folder1/%' " +
"  AND NOT jcr:path LIKE '/Folder1/%/%' "
And the result will be only the nodes under the Folder1 but not their subnodes, OK, it works.

But if I put the following:
"SELECT * FROM my:base WHERE jcr:path LIKE '/Folder1/F%' "
I want the nodes under Folder1 and begining the name with F, but there is no results. Why, is this an issue or it is out of the spec of jcr?
Is there another way to get the nodes in such situation?

Thanks
Helio.





Re: Searching with like over the path

Posted by Marcel Reutegger <ma...@day.com>.
Hi Helio,

On 6/26/06, hsp <pi...@ibest.com.br> wrote:
> "SELECT * FROM my:base WHERE jcr:path LIKE '/Folder1/F%' "
> I want the nodes under Folder1 and begining the name with F, but
> there is no results. Why, is this an issue or it is out of the spec of jcr?

The jcr:path is only a pseudo property, which means there are a lot of
restrictions on it. you can basically use it to restrict the results
to a certain subtree. Everything else you can think of is not
specified in jsr 170.

> Is there another way to get the nodes in such situation?

no, currently not. but it is on the wish list of several people to
support the fn:name() in XPath or similar. See:
http://thread.gmane.org/gmane.comp.apache.jackrabbit.devel/6476/

There are also ongoing discussions in the jsr 283 expert group on
enhancements in this area.

regards
 marcel