On 14.12.2012, at 18:33, Robert Haycock 
<[email protected]> 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/8.5.4.4_LIKE.html

Cheers,
Alex

Reply via email to