BindVariable in JCR-SQL2 CONTAINS

3 messages Options
Embed this post
Permalink
Philipp Bunge-2

BindVariable in JCR-SQL2 CONTAINS

Reply Threaded More More options
Print post
Permalink
Hi

I'm trying to use the following FullTextSearch query in Jackrabbit 2.0 beta1:
Query query = qm.createQuery("SELECT * FROM [my:document] AS document
WHERE CONTAINS(document.original, $x)", Query.JCR_SQL2);

But the following fails with a "java.lang.IllegalArgumentException:
not a valid variable in this query:"
query.bindVariable("x", vf.createValue("moo"));

In fact, query.getBindVariableNames() returns an empty array.

Did I miss something?

Thanks in advance,
Philipp
Thomas Müller-2

Re: BindVariable in JCR-SQL2 CONTAINS

Reply Threaded More More options
Print post
Permalink
Hi,

I'm not sure, but it looks like a bug in Jackrabbit. The statement
seems to be parsed correctly, but extracting the bind variables
doesn't pick it up. Could you file a Jira bug report please? Just copy
& paste the example code below, that's enough to reproduce the issue.

Regards,
Thomas


On Mon, Nov 2, 2009 at 3:28 PM, Philipp Bunge <[hidden email]> wrote:

> Hi
>
> I'm trying to use the following FullTextSearch query in Jackrabbit 2.0 beta1:
> Query query = qm.createQuery("SELECT * FROM [my:document] AS document
> WHERE CONTAINS(document.original, $x)", Query.JCR_SQL2);
>
> But the following fails with a "java.lang.IllegalArgumentException:
> not a valid variable in this query:"
> query.bindVariable("x", vf.createValue("moo"));
>
> In fact, query.getBindVariableNames() returns an empty array.
>
> Did I miss something?
>
> Thanks in advance,
> Philipp
>
Philipp Bunge-2

Re: BindVariable in JCR-SQL2 CONTAINS

Reply Threaded More More options
Print post
Permalink
Hi Thomas!

> I'm not sure, but it looks like a bug in Jackrabbit. The statement
> seems to be parsed correctly, but extracting the bind variables
> doesn't pick it up. Could you file a Jira bug report please? Just copy
> & paste the example code below, that's enough to reproduce the issue.

Thanks for the quick reply!

I've created a bug report.
https://issues.apache.org/jira/browse/JCR-2379

Philipp