事实上,在这种情况下,我需要一些随机排序的解决方案。我尝试按Collections
SolrDocumentList randSolrDocs = Collections.shuffle(solrDocList)
但收到错误Type mismatch: cannot convert from void to SolrDocumentList
。
请帮助。
答案 0 :(得分:1)
Collections.shuffle(solrDocList)
将您传递的列表作为参数进行随机播放。该方法没有返回值。
所以在通话结束后,solrDocList
会被随机化。