Oh, yes, OR makes more sense than AND in this case ;-) Regards, Alex
On Fri, Mar 19, 2010 at 09:48, gary long <[email protected]> wrote: > ----- Message d'origine ----- > De : Alexander Klimetschek > Envoyés : 18.03.10 18:37 > À : [email protected] > Objet : Re: problem with SQL query and full text search > > On Thu, Mar 18, 2010 at 18:12, gary long <[email protected]> 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 > [email protected] > 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 [email protected]
