jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabián Mandelbaum <fmandelb...@gmail.com>
Subject Searching for file names (nt:file node names) with JR 1.6.x
Date Fri, 22 Oct 2010 13:53:47 GMT
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%'

There are nt:file nodes named Samba{1,2,3}.xml inside the
/workspaces/W1/content nt:folder node, but even so the query returns
empty.

If I specify the full file name, like this:

SELECT * FROM nt:file WHERE jcr:path LIKE '/workspaces/W1/content/Samba1.xml%'

then the query does succeed returning the expected node, but of course
this is not what I need.

Before I have to change my repo storage structure adding a property
with the file's name (which would be redundant since the node's name
is the file name already), and I have to write a tool for our users to
migrate their production repos adding the property in question, do you
have any ideas on how I may solve this problem?

-- 
Fabián Mandelbaum
IS Engineer

Mime
View raw message