jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Waschkowski" <mwaschkow...@gmail.com>
Subject Re: case insensitve searches
Date Tue, 25 Sep 2007 13:54:22 GMT
OK, thanks for the clarification. I've followed your example and works well.
It would be nice to be able to specify case insensitivity for the query as a
whole, rather than having to force case on all values, but maybe I'll
suggest that in a jira...

Thanks again,

Mark

On 9/24/07, Torgeir Veimo <torgeir@pobox.com> wrote:
>
>
> On 24 Sep 2007, at 23:17, Mark Waschkowski wrote:
>
> > I saw from earlier messages that there is a function 'fn:lower-
> > case' to
> > allow searches to be done by making search criteria lower case, but
> > I need
> > something a bit less constrained. We have data in a repository that
> > has a
> > title with case, and an input box that our users can input values
> > to search
> > on (for said title). They may not be sure of the case of the title,
> > so we
> > need to do a case insensitive search.
> >
> > ie.
> > Stored as: "The Big Company"
> > Input as: Big company
> >
> > and see a hit in the results. Does jackrabbit support this?
>
> The fn:lower-case doesn't necessarily apply to the search string. It
> can apply to the field you're searching, so you'd get exactly what
> you're after.
>
> Eg. I do something like
>
> String queryString = "/jcr:root/nen:content" + path + "//element
> (*,nen:tag)[jcr:like(fn:lower-case(@nen:tag),'" + queryString + "%')]";
>
> The queryString I've already converted to lowercase using plain java
> method.
>
> --
> Torgeir Veimo
> torgeir@pobox.com
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message