You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by bhaskar chandrasekar <ba...@yahoo.co.in> on 2009/09/29 12:21:30 UTC

Usage of Sort and fq

Hi,
 
Can some one let me know how to use sort and fq parameters in Solr.
Any examples woould be appreciated.
 
Regards
Bhaskar


      

Re: Usage of Sort and fq

Posted by Matt Weber <ma...@mattweber.org>.
A description and examples of both parameters can be found here:

http://wiki.apache.org/solr/CommonQueryParameters

Thanks,

Matt Weber

On Sep 29, 2009, at 4:10 AM, Avlesh Singh wrote:

> /?q=*:*&fq:category:animal&sort=child_count%20asc
>
> Search for all documents (of animals), and filter the ones that  
> belong to
> the category "animal" and sort ascending by a field called  
> child_count that
> contains number of children for each animal.
>
> You can pass multiple fq's with more "&fq=..." parameters. Secondary,
> tertiary sorts can be specified using comma (",") as the separator.  
> i.e.
> "sort=fieldA asc,fieldB desc, fieldC asc, ..."
>
> Cheers
> Avlesh
>
> On Tue, Sep 29, 2009 at 3:51 PM, bhaskar chandrasekar
> <ba...@yahoo.co.in>wrote:
>
>> Hi,
>>
>> Can some one let me know how to use sort and fq parameters in Solr.
>> Any examples woould be appreciated.
>>
>> Regards
>> Bhaskar
>>
>>
>>


Re: Usage of Sort and fq

Posted by Avlesh Singh <av...@gmail.com>.
/?q=*:*&fq:category:animal&sort=child_count%20asc

Search for all documents (of animals), and filter the ones that belong to
the category "animal" and sort ascending by a field called child_count that
contains number of children for each animal.

You can pass multiple fq's with more "&fq=..." parameters. Secondary,
tertiary sorts can be specified using comma (",") as the separator. i.e.
"sort=fieldA asc,fieldB desc, fieldC asc, ..."

Cheers
Avlesh

On Tue, Sep 29, 2009 at 3:51 PM, bhaskar chandrasekar
<ba...@yahoo.co.in>wrote:

> Hi,
>
> Can some one let me know how to use sort and fq parameters in Solr.
> Any examples woould be appreciated.
>
> Regards
> Bhaskar
>
>
>