2013-07-15 37 views
-1

事实上,在这种情况下,我需要一些随机排序的解决方案。我试图通过Collections如何排序solrdocumentlist对象

SolrDocumentList randSolrDocs = Collections.shuffle(solrDocList) 

排序却收到一个错误Type mismatch: cannot convert from void to SolrDocumentList

请帮忙。

回答

1

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

所以在通话之后,solrDocList是随机的。

+0

非常感谢,我的可怕的注意力不集中 –