jcr:like ignore case

8 messages Options
Embed this post
Permalink
Nicolas Brasseur

jcr:like ignore case

Reply Threaded More More options
Print post
Permalink
Hi there,

I am currently testing the jcr:like function in xpath queries, I was wondering if it was possible to change the jcr:like behavior to ignore case or not ?

thanks for you advices

N.



     
Nicolas Brasseur

Re: jcr:like ignore case

Reply Threaded More More options
Print post
Permalink
Hi,

does anybody could help me on this one ?

thanks in advance

Nicolas



----- Original Message ----
From: Nicolas Brasseur <[hidden email]>
To: jackrabbit mailing list <[hidden email]>
Sent: Mon, October 5, 2009 9:41:55 PM
Subject: jcr:like ignore case

Hi there,

I am currently testing the jcr:like function in xpath queries, I was wondering if it was possible to change the jcr:like behavior to ignore case or not ?

thanks for you advices

N.


     
Alexander Klimetschek

Re: jcr:like ignore case

Reply Threaded More More options
Print post
Permalink
In reply to this post by Nicolas Brasseur
On Mon, Oct 5, 2009 at 21:41, Nicolas Brasseur
<[hidden email]> wrote:
> I am currently testing the jcr:like function in xpath queries, I was wondering if it was possible to change the jcr:like behavior to ignore case or not ?

AFAIK jcr:like is meant for exact matches (+ % wildcards) and hence
does not ignore the case. For fuzzy fulltext searches, use
jcr:contains, it should ignore the case.

Regards,
Alex

--
Alexander Klimetschek
[hidden email]
Marcel Reutegger

Re: jcr:like ignore case

Reply Threaded More More options
Print post
Permalink
Hi,

On Fri, Oct 9, 2009 at 09:55, Alexander Klimetschek <[hidden email]> wrote:
> On Mon, Oct 5, 2009 at 21:41, Nicolas Brasseur
> <[hidden email]> wrote:
>> I am currently testing the jcr:like function in xpath queries, I was wondering if it was possible to change the jcr:like behavior to ignore case or not ?
>
> AFAIK jcr:like is meant for exact matches (+ % wildcards) and hence
> does not ignore the case. For fuzzy fulltext searches, use
> jcr:contains, it should ignore the case.

right, and it is generally faster than jcr:like.

if you really want to use jcr:like case insensitive you can do:

//element(*, my:type)[jcr:like(fn:lower-case(@foo), 'bar%')]

regards
 marcel
krobblestopper

Re: jcr:like ignore case

Reply Threaded More More options
Print post
Permalink
How would this function be called via a SQL-style query? I am currently doing an 'order by jcr:title'.
Marcel Reutegger

Re: jcr:like ignore case

Reply Threaded More More options
Print post
Permalink
//element(*, my:type)[jcr:like(fn:lower-case(@foo), 'bar%')]

is equivalent to

SELECT * FROM my:type WHERE LOWER(foo) LIKE 'bar%'

regards
 marcel

On Sat, Oct 10, 2009 at 03:59, krobblestopper <[hidden email]> wrote:
>
> How would this function be called via a SQL-style query? I am currently doing
> an 'order by jcr:title'.
>
> --
> View this message in context: http://www.nabble.com/jcr%3Alike-ignore-case-tp25757631p25830297.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>
krobblestopper

Re: jcr:like ignore case

Reply Threaded More More options
Print post
Permalink
I notice that in the SQL syntax, order by LOWER(jcr:title) is not supported. Putting the LOWER in the order by throws an error. Are there plans to add this functionality?
Thomas Müller-2

Re: jcr:like ignore case

Reply Threaded More More options
Print post
Permalink
Hi,

> I notice that in the SQL syntax, order by LOWER(jcr:title) is not supported.
> Putting the LOWER in the order by throws an error. Are there plans to add
> this functionality?

It works with Jackrabbit 2.0 / SQL-2 (according to my test).

Regards,
Thomas