如何对solrdocumentlist对象进行排序

时间:2013-07-15 12:46:06

标签: java sorting solr lucene

事实上,在这种情况下,我需要一些随机排序的解决方案。我尝试按Collections

排序
SolrDocumentList randSolrDocs = Collections.shuffle(solrDocList)

但收到错误Type mismatch: cannot convert from void to SolrDocumentList

请帮助。

1 个答案:

答案 0 :(得分:1)

Collections.shuffle(solrDocList)将您传递的列表作为参数进行随机播放。该方法没有返回值。

所以在通话结束后,solrDocList会被随机化。