You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Rory Franklin <ro...@chillibean.tv> on 2012/05/04 12:59:16 UTC
CouchDB Lucene Sorting query
Hi,
I need to be able to sort on two fields on a CouchDB Lucene index, but the requirement is to be able to sort ascending for one field and descending for the other. Is this possible? I'm using the following syntax but it doesn't appear to make a difference when I change the second sort direction:
sort=\created_at,/company_name
Is this possible?
--
Rory
Re: CouchDB Lucene Sorting query
Posted by Robert Newson <rn...@apache.org>.
heh, no problem, glad it's working. :)
On 4 May 2012 12:15, Rory Franklin <ro...@chillibean.tv> wrote:
> Hi,
>
> Turns out I'm just being a spanner and the reason nothing was changing was due to my first field being a date, so there was no opportunity for the second sort field to affect the results. Testing this with other fields works like a charm. Sorry for wasting your time!
>
>
>
> Rory
>
>
> On Friday, 4 May 2012 at 12:05, Robert Newson wrote:
>
>> Hi Rory,
>>
>> Yes, it should be possible and you appear to be using correct syntax
>> (assuming your sort parameter is actually reaching the couchdb-lucene
>> server). What results are you getting? What version of couchdb-lucene
>> are you using? If you try the query again and add &debug=true, you
>> should get some more info. Feel free to include that in this thread.
>>
>> B.
>>
>> On 4 May 2012 11:59, Rory Franklin <rory@chillibean.tv (mailto:rory@chillibean.tv)> wrote:
>> > Hi,
>> >
>> > I need to be able to sort on two fields on a CouchDB Lucene index, but the requirement is to be able to sort ascending for one field and descending for the other. Is this possible? I'm using the following syntax but it doesn't appear to make a difference when I change the second sort direction:
>> >
>> > sort=\created_at,/company_name
>> >
>> > Is this possible?
>> >
>> > --
>> >
>> > Rory
>
Re: CouchDB Lucene Sorting query
Posted by Rory Franklin <ro...@chillibean.tv>.
Hi,
Turns out I'm just being a spanner and the reason nothing was changing was due to my first field being a date, so there was no opportunity for the second sort field to affect the results. Testing this with other fields works like a charm. Sorry for wasting your time!
Rory
On Friday, 4 May 2012 at 12:05, Robert Newson wrote:
> Hi Rory,
>
> Yes, it should be possible and you appear to be using correct syntax
> (assuming your sort parameter is actually reaching the couchdb-lucene
> server). What results are you getting? What version of couchdb-lucene
> are you using? If you try the query again and add &debug=true, you
> should get some more info. Feel free to include that in this thread.
>
> B.
>
> On 4 May 2012 11:59, Rory Franklin <rory@chillibean.tv (mailto:rory@chillibean.tv)> wrote:
> > Hi,
> >
> > I need to be able to sort on two fields on a CouchDB Lucene index, but the requirement is to be able to sort ascending for one field and descending for the other. Is this possible? I'm using the following syntax but it doesn't appear to make a difference when I change the second sort direction:
> >
> > sort=\created_at,/company_name
> >
> > Is this possible?
> >
> > --
> >
> > Rory
Re: CouchDB Lucene Sorting query
Posted by Robert Newson <rn...@apache.org>.
Hi Rory,
Yes, it should be possible and you appear to be using correct syntax
(assuming your sort parameter is actually reaching the couchdb-lucene
server). What results are you getting? What version of couchdb-lucene
are you using? If you try the query again and add &debug=true, you
should get some more info. Feel free to include that in this thread.
B.
On 4 May 2012 11:59, Rory Franklin <ro...@chillibean.tv> wrote:
> Hi,
>
> I need to be able to sort on two fields on a CouchDB Lucene index, but the requirement is to be able to sort ascending for one field and descending for the other. Is this possible? I'm using the following syntax but it doesn't appear to make a difference when I change the second sort direction:
>
> sort=\created_at,/company_name
>
> Is this possible?
>
> --
>
> Rory