jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Fuzzy query & node name
Date Mon, 11 Aug 2008 17:55:05 GMT
On Fri, Aug 8, 2008 at 8:37 PM, C├ędric Chantepie <cchantepie@corsaire.fr> wrote:
> Hello,
> I'm a Jackrabbit newbie, and I looking for a mean to perform fuzzy query
> over node names.
> In fact I'd like to find node whose name is like (fuzzy match) "something".
> I'm using Jackrabbit 1.4.5, I've tried "//*[jcr:contains(fn:name(),
> 'something~0.7']" or "//*[jcr:like(fn:name(), 'something%')]" but I get
> errors.

What kind of errors?

Please not that jcr:contains with a ~ is a synoym search and is
disabled by default (see here
http://wiki.apache.org/jackrabbit/SynonymSearch) and jcr:like on the
other hand is always enabled and works like the LIKE in SQL (hah, I
liked that sentence ;-)).

Additionally, I think the queries are both illegal:

The jcr:contains() should use a "." instead of fn:name(), eg.

//*[jcr:contains(., 'something~0.7')]

You could also use a specific property here:

//*[jcr:contains(@myprop, 'something~0.7')]

The jcr:like() method must have a property as the first paramter, eg.

//*[jcr:like(@myprop, 'something%')]


Alexander Klimetschek

View raw message