On Mon, Jun 21, 2010 at 14:24, Rencana Tarigan <[email protected]> wrote: > Hi, can someone give me example for query using xpath or sql in jackrabbit.. > for example i want get a result that the content contains "text" and path > like %text% so the result will : > result1.txt <-- this file contains "text" > atext.doc > texta.doc > atexta.doc
You can't do explicit wildcard searches on node (file) names with JCR xpath or SQL from the jcr 1.0 spec. But afaik, normally the full text for aggregated node types (depends on the indexing config) such as nt:file will include its name, thus a full text search with the node scope '.' should find both: //element(*, nt:file)[jcr:contains(., 'text')] Wildcard ode name searches are possible with JCR-SQL2 (since Jackrabbit / JCR 2.0): SELECT * FROM [nt:file] WHERE LOCALNAME() LIKE '%text%' Regards, Alex -- Alexander Klimetschek [email protected]
