jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: fulltext search & sql query
Date Mon, 14 Sep 2009 15:18:12 GMT
On Mon, Sep 14, 2009 at 16:07, Gary Long <gary.long@gmx.fr> wrote:
> I have a JCR with files converted into binary and i'm trying to perform
> fulltext search. I'm using SQL.
> My query is :
>
> "SELECT * FROM mnt:resource WHERE contains(* , '" + textQuery + " OR " +
> textQuery + "% OR %" + textQuery + " OR %" + textQuery + "%')"
>
> When i try  for the word lucene (for exemple) i get results. But if i try
> with luc or lucen, there are no matches...

The (JCR-) SQL CONTAINS and the Xpath jcr:contains methods do not
support wildcard characters, as they are working on a tokenized
fulltext index. For using wildcard queries, there is LIKE/jcr:like
which works directly on properties:

SELECT * FROM mnt:resource WHERE (my:property LIKE lucene) OR
(my:property LIKE luc%) OR (my:property LIKE %ene)

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message