NamedList<SolrDocumentList> buildMoreLikeThisNamed(Map<Object,SolrDocumentList> allMlt,Map<Object,ShardDoc> resultIds){
  NamedList<SolrDocumentList> result=new NamedList<>();
  TreeMap<Integer,Object> sortingMap=new TreeMap<>();
  for (  Entry<Object,ShardDoc> next : resultIds.entrySet()) {
    sortingMap.put(next.getValue().positionInResponse,next.getKey());
  }
  for (  Object key : sortingMap.values()) {
    SolrDocumentList sdl=allMlt.get(key);
    if (sdl == null) {
      sdl=new SolrDocumentList();
      sdl.setNumFound(0);
      sdl.setStart(0);
    }
    result.add(key.toString(),sdl);
  }
  return result;
}

NamedList < SolrDocumentList > buildMoreLikeThisNamed ( Map < Object , SolrDocumentList > allMlt , Map < Object , ShardDoc > resultIds ) { NamedList < SolrDocumentList > result = new NamedList < > ( ) ; TreeMap < Integer , Object > sortingMap = new TreeMap < > ( ) ; for ( Entry < Object , ShardDoc > next : resultIds . entrySet ( ) ) { sortingMap . put ( next . getValue ( ) . positionInResponse , next . getKey ( ) ) ; } for ( Object key : sortingMap . values ( ) ) { SolrDocumentList sdl = allMlt . get ( key ) ; if ( sdl == null ) { sdl = new SolrDocumentList ( ) ; sdl . setNumFound ( 0 ) ; sdl . setStart ( 0 ) ; } result . add ( key . toString ( ) , sdl ) ; } return result ; }
returns namedlist based on the order of resultids . sharddoc . positioninresponse
