Hi,

What version of Jackrabbit do you use? How does the code look like
exactly? I can't reproduce the problem with:

QueryManager qm = session.getWorkspace().getQueryManager();
String sql = "SELECT * FROM [nt:resource]";
Query query = qm.createQuery(sql, Query.JCR_SQL2);

(works for me).

Regards,
Thomas

On Tue, Jan 26, 2010 at 12:04 PM, Bastian Spanneberg
<[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Alexander Klimetschek wrote:
>> http://www.h2database.com/jcr/grammar.html
>> http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt?view=markup
>>
>
> Thx Alex, that helped.
>
> But I still have problems doing the search that I wanted to do.
>
> I've set up the Jackrabbit webapp and used the "Populate" page to load
> some documents into the repository. Now I want to do a full text search
> query.
>
> I've tried the following:
>
> SELECT * FROM [nt:file] AS file WHERE contains(file.*,'text')
>
> but this gives no results. Another query I've tried, as the nt:file node
> type definition states that the actual content of the files is stored in
> nt:resource nodes, is
>
> SELECT * FROM [nt:resource]
>
> but that results in a exception
> javax.jcr.RepositoryException: ':' not allowed in name
>
> whereas the same query using nt:file works fine.
>
> Can anyone say what's wrong and how to do a full text search with JCR-SQL2 ?
>
> - --
> Linkwerk - Software und Beratung für vernetzte Information
> Telefon:   +49 40 69 66 48 14
> Web:       www.linkwerk.com
>
> Linkwerk GmbH, Oberaltenallee 20a, 22081 Hamburg,
> Handelsregister Hamburg, HRB 95084
> Geschäftsführer: Stefan Mintert
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAktezEAACgkQSm4S1ty9BPVc/QCg11ce7JqfGgGqt5mevgffZeLe
> 5yIAmwRpySC76qdS/y5LPEKbBg5ypL++
> =wPBr
> -----END PGP SIGNATURE-----
>

Reply via email to