jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Corbet <ncor...@towerhillservices.com>
Subject Re: Searching for file names (nt:file node names) with JR 1.6.x
Date Fri, 22 Oct 2010 17:35:01 GMT
Fabián Mandelbaum <fmandelbaum <at> gmail.com> writes:

> Hello there,
> I'm using JackRabbit 1.6.2 on my project and I was wondering which
> would be the query to execute (either XPath or SQL) to be able to
> search for a given string in a file name (search in file names). I've
> tried all examples I've found on the web and none is working. I've
> tried things like this:
> SELECT * FROM nt:file WHERE jcr:path LIKE '/workspaces/W1/content/Samba[%]/%'
> SELECT * FROM nt:file WHERE jcr:path LIKE '/workspaces/W1/content/Samba%'

I think you may want to use the fn:name() function in the query. Something like:
" fn:name() LIKE 'Samba' " you could include the "jcr:path LIKE 
'/workspaces/W1/content/%'" to help guide it down the right path and use 
fn:name() to narrow it down to a set of names. 

View raw message