jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: Search - contains with wildcard and UUIDs and dashes
Date Fri, 14 Dec 2012 18:53:58 GMT
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