Hello Wouter,

the thing you are doing does not work (beside i am not sure what it is
supposed to do). So, IIUC, you want a query like:

Give me all documents where x or y ordered by score. Therefor, all you
do is:

<d:where>
        <d:or>
                <S:property-contains>
                   <d:prop><hc:multiValueProperty/></d:prop>
                   <d:literal>x</d:literal
                </S:property-contains>
            <S:property-contains>
                   <d:prop><hc:multiValueProperty/></d:prop>
                   <d:literal>y</d:literal
                </S:property-contains>
        <d:or>
</d:where>
<d:orderby>
        <d:order>
                <d:prop><d:score/></d:prop>
        </d:order>
</d:orderby>

Now, you get all documents returned where at least one of the above
matches are fulfilled, and you order on score.  

NOTE: <d:score/> is only available in the latest repository release. 

Regards Ard

> Hi guys,
> 
> I have documents in the repository with a multi-value, 
> comma-seperated property. I've created a DASL to find N 
> results, where at least one value in the multi-value property 
> matches a list of values. The results need to be sorted by 
> the priority of the value. A simple example:
> 
> This is my value list for the query: B, A, C, D I have three 
> documents: 1 (properties: A & C), 2 (properties: B & D), 3 
> (properties: A & D) Expected sorting: 2, 1, 3
> 
> My initial idea was to use strict-property-contains as a 
> boolean sorter (if true, the result goes on top):
> 
> <d:orderby>
>     <d:order>
>         <S:strict-property-contains>
>             <d:prop>
>                 <hc:multiValueProperty/>
>             </d:prop>
>             <d:literal>B</d:literal>
>         </S:strict-property-contains>
>     </d:order>
>     <d:order>
>         <S:strict-property-contains>
>             <d:prop>
>                 <hc:multiValueProperty/>
>             </d:prop>
>             <d:literal>A</d:literal>
>         </S:strict-property-contains>
>     </d:order>
>     ...
> </d:orderby>
> 
> Unfortunately, this seems to be illegal. Is there another way 
> to do this the proper way (in one query)?
> 
> Regards,
> 
> Wouter Zelle
> 
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to