On Thu, Aug 27, 2009 at 10:29 AM, Preetam Rao<blogathan....@gmail.com> wrote:
> Hi,
> If I have documents of type a, b and c but when I sort by some criteria,
> lets say date,
> can I make documents of kind c always appear at the bottom ?

One way is to simply use sorting.
You could have a string field called "type_c" with
sortMissingFirst="true" (see the example schema)
Index "yes" for all documents that are of type_c
Then to sort by date, use sort=type_c desc, date desc

If one needed to put type c docs at the top or bottom, then index "1"
for type c and "2" for other types, and then sort asc or desc as
needed.

-Yonik
http://www.lucidimagination.com


> So effectively I want one kind of records always appear at the bottom since
> they don't have valid data,
> whether sort is ascending or descending;
>
> Would a function query help here ? Or is it even possible ?
>
> Thanks
> Preetam
>

Reply via email to