How to sort two fields in Solr 3.6

2019-04-28 01:35发布

问题:

In the web request url there is a "sort" option. However, how do i sort by two fields? If I do something like:

 sort=field1 asc&sort=field2 desc

Only the first field will be used for sorting upon my observations.

回答1:

you do it this way:

sort=field1 asc, field2 desc


回答2:

SOLR(3.6.2) but if you want to sort additional intField in couple with 'score'
try to search instead of:

sort=score desc,intField desc

this one:

sort=intField desc,score desc


标签: solr