jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: How to find file by name?
Date Fri, 20 Nov 2009 14:40:28 GMT
On Fri, Nov 20, 2009 at 11:39, Vadim <vadim.rozov@ardas.dp.ua> 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
alexander.klimetschek@day.com

----------------------------< alexander.klimetschek@day.com >----------
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/

Mime
View raw message