Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
事实上,在这种情况下,我需要一些随机排序的解决方案。我试图排序Collections
Collections
SolrDocumentList randSolrDocs = Collections.shuffle(solrDocList)
但收到错误Type mismatch: cannot convert from void to SolrDocumentList。
Type mismatch: cannot convert from void to SolrDocumentList
请帮忙。
Collections.shuffle(solrDocList)打乱您作为参数传递的列表。该方法没有返回值。
Collections.shuffle(solrDocList)
所以调用后,solrDocList是随机的。
solrDocList