docs: @SuppressWarnings("unchecked")
    public SimpleOrderedMap<Object> create(ComponentTermVector termVector,
        Boolean encode) throws IOException {
      SimpleOrderedMap<Object> mtasTermVectorResponse = new SimpleOrderedMap<>();
      mtasTermVectorResponse.add("key", termVector.key);
  
      termVector.subComponentFunction.dataCollector.close();
  
      HashMap<MtasDataCollector<?, ?>, HashMap<String, MtasSolrMtasResult>> functionData = new HashMap<>();
      HashMap<String, MtasSolrMtasResult> functionDataItem = new HashMap<>();
      functionData.put(termVector.subComponentFunction.dataCollector,
          functionDataItem);
      if (termVector.functions != null) {
        for (SubComponentFunction function : termVector.functions) {
          function.dataCollector.reduceToKeys(
              termVector.subComponentFunction.dataCollector.getKeyList());
          function.dataCollector.close();
          functionDataItem.put(function.key, new MtasSolrMtasResult(
              function.dataCollector, new String[] { function.dataType },
              new String[] { function.statsType },
              new SortedSet[] { function.statsItems }, new List[] { null },
              new String[] { null }, new String[] { null }, new Integer[] { 0 },
              new Integer[] { Integer.MAX_VALUE }, null));
        }
      }
      MtasSolrMtasResult data = new MtasSolrMtasResult(
          termVector.subComponentFunction.dataCollector,
          new String[] { termVector.subComponentFunction.dataType },
          new String[] { termVector.subComponentFunction.statsType },
          new SortedSet[] { termVector.subComponentFunction.statsItems },
          new List[] { termVector.distances },
          new String[] { termVector.subComponentFunction.sortType },
          new String[] { termVector.subComponentFunction.sortDirection },
          new Integer[] { 0 }, new Integer[] { termVector.number }, functionData);
      if (encode) {
        mtasTermVectorResponse.add("_encoded_list",
            MtasSolrResultUtil.encode(data));
      } else {
        mtasTermVectorResponse.add("list", data);
        MtasSolrResultUtil.rewrite(mtasTermVectorResponse, searchComponent);
      }
      return mtasTermVectorResponse;
    }