jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Slashes in wildcard query string do not work
Date Thu, 26 Feb 2009 15:45:31 GMT
On Thu, Feb 26, 2009 at 10:47 AM, PThiemann
<philipp.thiemann@googlemail.com> wrote:
> //element(*,
> custom:file)[jcr:contains(custom:extendedProperties/@XYZ,'F/OS*')]/custom:extendedProperties/rep:excerpt(.)
>
> Now there is the strange thing. When I search (leaving out the /) for the
> following I can see my result again.
> //element(*, custom:file)[jcr:contains(custom:extendedProperties/@XYZ,'F
> OS*')]/custom:extendedProperties/rep:excerpt(.)
>
> Is the slash not indexed by lucene or do I have to escape the slash for
> Jackrabbit for not being recognized as path delimiter?

Instead of the "fuzzy" jcr:contains() method, you could use jcr:like()
which is more accurate if you want to match simple properties - it
uses "%" as wildcard (just as sql LIKE):

//element(*,custom:file)[jcr:like(custom:extendedProperties/@XYZ,'F/OS%')]/custom:extendedProperties/rep:excerpt(.)

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message