On Fri, Jul 3, 2009 at 2:16 PM, Kooper<[email protected]> wrote:
>
> Hi,
> I have the following issue:
> jackrabbit search does not work with jcr:contains(@title, '&'), i have query
> something like this:
>
> //*[(jcr:like(fn:lower-case(@type), '%binder%') or
> jcr:like(fn:lower-case(@type), '%document%')) and (jcr:contains(@title,
> '&'))] order by �...@jcr:created descending
>
> it returns 0, but names with & exists in JCR, when I do search with
> combination '&' + letter it works ok. Does any one know how it could be
> solved? Any help will be appreciated.

Try jcr:like(@title, '%&%'). The contains works on the Lucene-analyzed
words, so I guess & is considered a delimiter and not put into the
index as a single word.

The jcr:contains supports wildcards in form of '*' as well, so you
could do it with jcr:contains(@title, '*&*'), but my quick test showed
it fails if there are spaces next to the & char.

In general, don't rely on jcr:contains() for "specific",
application-based searches. It should always be used only for direct
"fuzzy" user searches.

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to