jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Re : Re: problem with SQL query and full text search
Date Fri, 19 Mar 2010 10:54:14 GMT
Oh, yes, OR makes more sense than AND in this case ;-)

Regards,
Alex

On Fri, Mar 19, 2010 at 09:48, gary long <gary.long@gmx.fr> wrote:
> ----- Message d'origine -----
> De : Alexander Klimetschek
> Envoyés : 18.03.10 18:37
> À : users@jackrabbit.apache.org
> Objet : Re: problem with SQL query and full text search
>
> On Thu, Mar 18, 2010 at 18:12, gary long <gary.long@gmx.fr> wrote:
>> Hi Hi :)
>>
>> I try to write a query that searches for a text in the properties of a certain type
of node in my repository. I thought it could be possible to write something like :
>>
>> SELECT * FROM mnt:resource WHERE contains((jcr:name, jcr:content), "my text");
>>
>> But it doesn't work :(
>>
>> So, is there a mean to specify multiple columns in a contains() or is it possible
to write multiple contains in a single SQL request?
>
> The latter, afaik (guessing you use JCR 1.0 jcr-sql):
>
> SELECT * FROM mnt:resource WHERE contains(jcr:name, "my text") AND
> contains(jcr:content, "my text")
>
> See also http://www.day.com/specs/jcr/1.0/8.5.4.5_CONTAINS.html
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>  Ok, so it's possible to write multiple contains() statements. Thank you for your help
:)
>
> My SQL request is now :
>
> SELECT * FROM mnt:resource WHERE contains("jcr:text", "some text") " +
>  "OR contains("jcr:name", "some text");
>
> And looks like it works ;)
>
> Regards,
> Gary
>



-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message