jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: bug in SQL CONTAINS?
Date Mon, 05 Feb 2007 08:11:34 GMT
Paco Avila wrote:
> I think that these queries equivalents:
> XPATH: //element(*, okm:document)[jcr:contains(okm:content, 'naranjas')]
> and
> SQL: SELECT * FROM okm:document WHERE CONTAINS(okm:content, 'naranjas')
> But the XPATH one works and the SQL doesn't return anything.

Those two queries are not equivalent. okm:content in the XPath case refers to 
the name of a node, whereas in SQL okm:content by definition refers to a property.

Only when you use XPath you can define whether a path refers to a node or a 
property using the @ (attribute axis). There's no such facility in SQL, 
therefore a relative path in a contains function always references a property.

But I'm open to suggestions how the XPath query could be mapped to SQL.


View raw message