jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Haycock <Robert.Hayc...@artificial-solutions.com>
Subject RE: Search - contains with wildcard and UUIDs and dashes
Date Mon, 17 Dec 2012 14:38:56 GMT
The fact is it finds the node when searching with the whole ID and no wildcard but doesn't
work when you add a wildcard.

That in my eyes is clearly a bug.

-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@adobe.com] 
Sent: 14 December 2012 18:54
To: users@jackrabbit.apache.org
Subject: Re: Search - contains with wildcard and UUIDs and dashes

On 14.12.2012, at 18:33, Robert Haycock <Robert.Haycock@artificial-solutions.com> wrote:

> These don't work...
> WHERE CONTAINS(document.id, 'fadeb7f3-224c-48e5-a92f-ca6e1939fa3b*')  
> // Note the wildcard on the end WHERE CONTAINS(document.id, 
> 'fadeb7f3*')
> Please could someone shed some light on why this doesn't work and how I can make it work.
I realise there is no reason for trying to do a wildcard search on a UUID but there comes
a time when we just do what we're told!!

CONTAINS() does a full text search, which doesn't work well for fixed "ID" strings, but is
meant for free form human text search. It is subject to word splitting, stemming etc.

You probably want to do a LIKE (which uses % as the * wildcard char):

WHERE document.id LIKE 'fadeb7f3%'

[0] http://www.day.com/specs/jcr/1.0/


View raw message