jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Search Query
Date Fri, 02 Jul 2010 10:16:28 GMT
On Mon, Jun 21, 2010 at 14:24, Rencana Tarigan
<rencana_tarigan@yahoo.co.id> 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
alexander.klimetschek@day.com

Mime
View raw message