XPath, the XML Path Language, is a query language for selecting nodes from an XML document. In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document. XPath was defined by the World Wide Web Consortium (W3C).
You can learn more about XPATH at http://www.w3.org/TR/xpath20/.
Locked documents by user therol
Search documents by content
//element(*, okm:document)[jcr:contains(okm:content, 'linux')]
Folders created by user potas
Example of complex query
Documents with content linux and keyword ubuntu:
//element(*,okm:document)[jcr:contains(okm:content,'linux') and jcr:contains(@okm:keywords,'ubuntu')]
//element(*, nt:linkedFile)/jcr:deref(@jcr:content, '*')[jcr:contains(., 'foo')]
We can specify the type of node that query returns. Restrictions include inheritage all subtype are included as possible results. The function element is used to evaluate a node type.
For example the node folders
A query can have property restrictions. The operators used are (=, !=, <, <=, >, >=) in addtion there's some extra operators like jcr:like() and jcr:contains().
//element(*, okm:folder)[@okm:author = 'pito']
Documents name starting with linux
//element(*, okm:document)[jcr:like(@okm:name, 'linux%')]
Documents with indexed content jackrabbit
//element(*, okm:resource)[jcr:contains(., 'jackrabbit')]/@jcr:path
At ends query can be indicated the order of results.
Ordering by name
//element(*, okm:document)[@okm:keywords != ''] order by @okm:name
Usually is used jcr:score to ordering, that indicates de ranking of the results.