jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paco Avila <pav...@git.es>
Subject Re: complex SQL search
Date Sat, 25 Nov 2006 13:55:09 GMT
El sáb, 25-11-2006 a las 13:05 +0100, ppakulski escribió:
> Hi,
> 
> You can't, joins are not supported as I know.
> But since JCR-247 has been resolved  I assume that you should be able to 
> execute following XPath query :
> 
> /okm:root//element(*,okm:document)[jcr:contains(@okm:name, '*.pdf') and 
> jcr:contains(okm:content, 'conejo')]
> 
> Przemo Pakulski

Oh, excellent! Thanks a lot! :)

> >I want to make a complex search in SQL filtered by some fields.
> >Someyhing like "I want all the documents which contains the word
> >'conejo' and which name ends with '.pdf'"
> >
> >My node structure is:
> >
> >[okm:document] > nt:hierarchyNode, mix:referenceable, mix:lockable,
> >mix:accessControlled
> >- okm:author (string) mandatory
> >- okm:name (string)
> >- okm:language (string)
> >- okm:keywords (string)
> >+ okm:content (okm:resource) primary mandatory
> >
> >I know howto filter by document name:
> >
> >	SELECT * FROM okm:document WHERE jcr:path LIKE '/okm:root/%' AND
> >CONTAINS(okm:name, '*.pdf')
> >
> >(this is a bit weird becasue CONTAINS(okm:name, '*pdf') returns more
> >results)
> >
> >An howto filter by content:
> >
> >	SELECT * FROM okm:resource WHERE jcr:path LIKE '/okm:root/%' AND
> >CONTAINS(., 'conejo')
> >
> >But I don't know howto join both queries.
> >  
> >


Mime
View raw message