jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Kahwe Smith <...@pooteeweet.org>
Subject Re: SQL2 and references
Date Tue, 27 Sep 2011 20:47:24 GMT

On Sep 27, 2011, at 22:39 , Jukka Zitting wrote:

> Hi Lukas,
> On Tue, Sep 27, 2011 at 10:20 PM, Lukas Kahwe Smith <mls@pooteeweet.org> wrote:
>> I am wondering how to do a search given the following
>> /foo/bar (UUID 1234, property "lala" is "huii")
>> /ding/dong (referencing UUID 1234)
>> now I want to do a search limited to children of "/ding" but when
>> searching I want it to search the contents of referenced nodes.
> As you noticed, references are not automatically followed by the query
> engine. What you can do instead is to use a join query like this:
>    SELECT dst.*
>    FROM [nt:base] AS src
>    JOIN [nt:unstructured] AS dst ON src.[reference] = dst.[jcr:uuid]
>    WHERE ISCHILDNODE(src, '/ding') AND dst.lala = 'huii'

I see but what about still being able to match with the same query?

/ding/booo (property "lala" is "huii")

i guess then i need to do a LEFT JOIN, which will likely put another dent on the performance,
but i guess thats the price of references.

Lukas Kahwe Smith

View raw message