On Fri, Nov 20, 2009 at 11:39, Vadim <[email protected]> wrote: > Hello, > I try to find file by name with Query, how can I do this? > I try "SELECT * FROM nt:file where name LIKE '%brochure.pdf%'" and > "SELECT * FROM nt:file where jcr:path LIKE '%brochure.pdf%'", but it > doesn't work.
See http://markmail.org/message/2ppoe5fxldd7abaw With it you can only match on exact node names. AFAIK fn:name() has no equivalent in SQL, it's not part of the spec and it's a Jackrabbit-extension anyway. Alternatively you can also use jcr:contains / CONTAINS, however this will also include full-text matches from within file content: //element(*, nt:file)[jcr:contains(., '.pdf') SELECT * FROM nt:file WHERE CONTAINS(., '.pdf') Regards, Alex -- Alexander Klimetschek [email protected] ----------------------------< [email protected] >---------- Alexander Klimetschek, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel, T +41 61 226 55 31, M +49 151 15 77 20 56 ---------------------------------------< http://www.day.com >----------------- Twitter: http://twitter.com/daysoftware Xing: http://www.xing.com/go/invite/3268380.32d2d4 LinkedIn: http://www.linkedin.com/in/klimetschek Blog: http://weblogs.goshaky.com/weblogs/alexkli/
