You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Chetan Mehrotra <ch...@gmail.com> on 2014/10/15 12:50:33 UTC

JCR sorting and array properties

Hi,

Is sorting possible on an array property? For now in Lucene I am
restricting sorting for non array property only so need to check if
that restriction is fine

Chetan Mehrotra

Re: JCR sorting and array properties

Posted by Michael Marth <mm...@adobe.com>.
Hi,

should we not check what the spec says about sorting MVPs? (and if allowed: model the behaviour after JR2?)

Cheers
Michael

On 15 Oct 2014, at 16:20, Amit Jain <am...@apache.org> wrote:

>> What should be the output with
>> 
>> /a {v: [1, 10]}
>> /b {v: [2,9]}
>> 
> 
> Shouldn't it be /a because its encountered first for both ascending and
> descending?


Re: JCR sorting and array properties

Posted by Amit Jain <am...@apache.org>.
> What should be the output with
>
> /a {v: [1, 10]}
> /b {v: [2,9]}
>

Shouldn't it be /a because its encountered first for both ascending and
descending?

Re: JCR sorting and array properties

Posted by Chetan Mehrotra <ch...@gmail.com>.
> It's unlikely that one would sort with a multi-valued property, but I
guess it's possible. Couldn't you index on all values?

I think Lucene would handle it but was confirming if this is a
practical usecase. Also it pose some issue with approach being taken
in OAK-2196.

What should be the output with

/a {v: [1, 10]}
/b {v: [2,9]}
Chetan Mehrotra


On Wed, Oct 15, 2014 at 5:14 PM, Thomas Mueller <mu...@adobe.com> wrote:
> Hi,
>
> It's unlikely that one would sort with a multi-valued property, but I
> guess it's possible. Couldn't you index on all values?
>
> Some strange behavior could occur. If we have two nodes:
>
> /a {v: [1, 10]}
> /b {v: 5}
>
> Then XPath "order by v" would return /a first (because of v=1), and then
> /b. And "order by v descending" would _also_ return /a first (because of
> v=10), and then /b.
>
> Regards,
> Thomas
>
> On 15/10/14 12:50, "Chetan Mehrotra" <ch...@gmail.com> wrote:
>
>>Hi,
>>
>>Is sorting possible on an array property? For now in Lucene I am
>>restricting sorting for non array property only so need to check if
>>that restriction is fine
>>
>>Chetan Mehrotra
>

Re: JCR sorting and array properties

Posted by Thomas Mueller <mu...@adobe.com>.
Hi,

It's unlikely that one would sort with a multi-valued property, but I
guess it's possible. Couldn't you index on all values?

Some strange behavior could occur. If we have two nodes:

/a {v: [1, 10]}
/b {v: 5}

Then XPath "order by v" would return /a first (because of v=1), and then
/b. And "order by v descending" would _also_ return /a first (because of
v=10), and then /b.

Regards,
Thomas

On 15/10/14 12:50, "Chetan Mehrotra" <ch...@gmail.com> wrote:

>Hi,
>
>Is sorting possible on an array property? For now in Lucene I am
>restricting sorting for non array property only so need to check if
>that restriction is fine
>
>Chetan Mehrotra