public SimpleOrderedMap<Object> create(ComponentDocument document,
      Boolean encode) throws IOException {
    SimpleOrderedMap<Object> mtasDocumentResponse = new SimpleOrderedMap<>();
    mtasDocumentResponse.add("key", document.key);
    ArrayList<NamedList<Object>> mtasDocumentItemResponses = new ArrayList<>();
    for (int docId : document.statsData.keySet()) {
      NamedList<Object> mtasDocumentItemResponse = new SimpleOrderedMap<>();
      MtasDataCollector<?, ?> stats = document.statsData.get(docId);
      MtasDataCollector<?, ?> list = null;
      if (document.statsList != null) {
        list = document.statsList.get(docId);
      }
      mtasDocumentItemResponse.add("stats",
          new MtasSolrMtasResult(stats, stats.getDataType(),
              stats.getStatsType(), stats.getStatsItems(), null, null));
      mtasDocumentItemResponse.add("documentKey",
          document.uniqueKey.get(docId));
      if (list != null) {
        if (document.listExpand) {
          mtasDocumentItemResponse.add("list",
              new MtasSolrMtasResult(list,
                  new String[] { list.getDataType(), list.getDataType() },
                  new String[] { list.getStatsType(), list.getStatsType() },
                  new SortedSet[] { list.getStatsItems(),
                      list.getStatsItems() },
                  new List[] { null, null }, new String[] { null, null },
                  new String[] { null, null }, new Integer[] { 0, 0 },
                  new Integer[] { 1, 1 }, null));
        } else {
          mtasDocumentItemResponse.add("list",
              new MtasSolrMtasResult(list, list.getDataType(),
                  list.getStatsType(), list.getStatsItems(), null, null));
        }

      }
      // add
      mtasDocumentItemResponses.add(mtasDocumentItemResponse);
    }
    mtasDocumentResponse.add("list", mtasDocumentItemResponses);
    MtasSolrResultUtil.rewrite(mtasDocumentResponse, searchComponent);
    return mtasDocumentResponse;
  }
public SimpleOrderedMap < Object > create ( ComponentDocument document , Boolean encode ) throws IOException { SimpleOrderedMap < Object > mtasDocumentResponse = new SimpleOrderedMap < > ( ) ; mtasDocumentResponse . add ( "key" , document . key ) ; ArrayList < NamedList < Object > > mtasDocumentItemResponses = new ArrayList < > ( ) ; for ( int docId : document . statsData . keySet ( ) ) { NamedList < Object > mtasDocumentItemResponse = new SimpleOrderedMap < > ( ) ; MtasDataCollector < ? , ? > stats = document . statsData . get ( docId ) ; MtasDataCollector < ? , ? > list = null ; if ( document . statsList != null ) { list = document . statsList . get ( docId ) ; } mtasDocumentItemResponse . add ( "stats" , new MtasSolrMtasResult ( stats , stats . getDataType ( ) , stats . getStatsType ( ) , stats . getStatsItems ( ) , null , null ) ) ; mtasDocumentItemResponse . add ( "documentKey" , document . uniqueKey . get ( docId ) ) ; if ( list != null ) { if ( document . listExpand ) { mtasDocumentItemResponse . add ( "list" , new MtasSolrMtasResult ( list , new String [ ] { list . getDataType ( ) , list . getDataType ( ) } , new String [ ] { list . getStatsType ( ) , list . getStatsType ( ) } , new SortedSet [ ] { list . getStatsItems ( ) , list . getStatsItems ( ) } , new List [ ] { null , null } , new String [ ] { null , null } , new String [ ] { null , null } , new Integer [ ] { 0 , 0 } , new Integer [ ] { 1 , 1 } , null ) ) ; } else { mtasDocumentItemResponse . add ( "list" , new MtasSolrMtasResult ( list , list . getDataType ( ) , list . getStatsType ( ) , list . getStatsItems ( ) , null , null ) ) ; } } mtasDocumentItemResponses . add ( mtasDocumentItemResponse ) ; } mtasDocumentResponse . add ( "list" , mtasDocumentItemResponses ) ; MtasSolrResultUtil . rewrite ( mtasDocumentResponse , searchComponent ) ; return mtasDocumentResponse ; }
/*
(non-Javadoc)

@see
mtas.solr.handler.component.util.MtasSolrComponent#create(mtas.codec.util.
CodecComponent.BasicComponent, java.lang.Boolean)