docs: public void prepare(ResponseBuilder rb, ComponentFields mtasFields)
        throws IOException {
      Set<String> ids = MtasSolrResultUtil
          .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR);
      if (!ids.isEmpty()) {
        int tmpCounter = 0;
        String[] fields = new String[ids.size()];
        String[] keys = new String[ids.size()];
        String[] prefixes = new String[ids.size()];
        String[][] distanceKeys = new String[ids.size()][];
        String[][] distanceTypes = new String[ids.size()][];
        String[][] distanceBases = new String[ids.size()][];
        Map<String, String>[][] distanceParameters = new Map[ids.size()][];
        String[][] distanceMinimums = new String[ids.size()][];
        String[][] distanceMaximums = new String[ids.size()][];
        String[] regexps = new String[ids.size()];
        String[] fulls = new String[ids.size()];
        String[] sortTypes = new String[ids.size()];
        String[] sortDirections = new String[ids.size()];
        String[] types = new String[ids.size()];
        String[] startValues = new String[ids.size()];
        String[] numbers = new String[ids.size()];
        String[] numberShards = new String[ids.size()];
        String[][] functionExpressions = new String[ids.size()][];
        String[][] functionKeys = new String[ids.size()][];
        String[][] functionTypes = new String[ids.size()][];
        String[] boundaries = new String[ids.size()];
        String[] lists = new String[ids.size()];
        Boolean[] listRegexps = new Boolean[ids.size()];
        String[] ignoreRegexps = new String[ids.size()];
        String[] ignoreLists = new String[ids.size()];
        Boolean[] ignoreListRegexps = new Boolean[ids.size()];
        for (String id : ids) {
          fields[tmpCounter] = rb.req.getParams().get(
              PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_FIELD,
              null);
          keys[tmpCounter] = rb.req.getParams().get(
              PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_KEY,
              String.valueOf(tmpCounter)).trim();
          prefixes[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
              + "." + id + "." + NAME_MTAS_TERMVECTOR_PREFIX, null);
          Set<String> distanceIds = MtasSolrResultUtil
              .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR
                  + "." + id + "." + NAME_MTAS_TERMVECTOR_DISTANCE);
          distanceKeys[tmpCounter] = new String[distanceIds.size()];
          distanceTypes[tmpCounter] = new String[distanceIds.size()];
          distanceBases[tmpCounter] = new String[distanceIds.size()];
          distanceParameters[tmpCounter] = new Map[distanceIds.size()];
          distanceMinimums[tmpCounter] = new String[distanceIds.size()];
          distanceMaximums[tmpCounter] = new String[distanceIds.size()];
          int tmpSubDistanceCounter = 0;
          for (String distanceId : distanceIds) {
            distanceKeys[tmpCounter][tmpSubDistanceCounter] = rb.req.getParams()
                .get(
                    PARAM_MTAS_TERMVECTOR + "." + id + "."
                        + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                        + NAME_MTAS_TERMVECTOR_DISTANCE_KEY,
                    String.valueOf(tmpSubDistanceCounter))
                .trim();
            distanceTypes[tmpCounter][tmpSubDistanceCounter] = rb.req.getParams()
                .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE_TYPE, null);
            distanceBases[tmpCounter][tmpSubDistanceCounter] = rb.req.getParams()
                .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE_BASE, null);
            distanceParameters[tmpCounter][tmpSubDistanceCounter] = new HashMap<>();
            Set<String> parameters = MtasSolrResultUtil.getIdsFromParameters(
                rb.req.getParams(),
                PARAM_MTAS_TERMVECTOR + "." + id + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE_PARAMETER);
            for (String parameter : parameters) {
              distanceParameters[tmpCounter][tmpSubDistanceCounter].put(parameter,
                  rb.req.getParams()
                      .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                          + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                          + NAME_MTAS_TERMVECTOR_DISTANCE_PARAMETER + "."
                          + parameter));
            }
            distanceMinimums[tmpCounter][tmpSubDistanceCounter] = rb.req
                .getParams()
                .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE_MINIMUM, null);
            distanceMaximums[tmpCounter][tmpSubDistanceCounter] = rb.req
                .getParams()
                .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE + "." + distanceId + "."
                    + NAME_MTAS_TERMVECTOR_DISTANCE_MAXIMUM, null);
            tmpSubDistanceCounter++;
          }
          regexps[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR + "."
              + id + "." + NAME_MTAS_TERMVECTOR_REGEXP, null);
          fulls[tmpCounter] = rb.req.getParams().get(
              PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_FULL,
              null);
          sortTypes[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
              + "." + id + "." + NAME_MTAS_TERMVECTOR_SORT_TYPE, null);
          sortDirections[tmpCounter] = rb.req.getParams()
              .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_SORT_DIRECTION, null);
          startValues[tmpCounter] = rb.req.getParams().get(
              PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_START,
              null);
          numbers[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR + "."
              + id + "." + NAME_MTAS_TERMVECTOR_NUMBER, null);
          numberShards[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
              + "." + id + "." + NAME_MTAS_TERMVECTOR_NUMBER_SHARDS, null);
          types[tmpCounter] = rb.req.getParams().get(
              PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_TYPE,
              null);
          Set<String> functionIds = MtasSolrResultUtil
              .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_TERMVECTOR
                  + "." + id + "." + NAME_MTAS_TERMVECTOR_FUNCTION);
          functionExpressions[tmpCounter] = new String[functionIds.size()];
          functionKeys[tmpCounter] = new String[functionIds.size()];
          functionTypes[tmpCounter] = new String[functionIds.size()];
          int tmpSubFunctionCounter = 0;
          for (String functionId : functionIds) {
            functionKeys[tmpCounter][tmpSubFunctionCounter] = rb.req.getParams()
                .get(
                    PARAM_MTAS_TERMVECTOR + "." + id + "."
                        + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionId + "."
                        + NAME_MTAS_TERMVECTOR_FUNCTION_KEY,
                    String.valueOf(tmpSubFunctionCounter))
                .trim();
            functionExpressions[tmpCounter][tmpSubFunctionCounter] = rb.req
                .getParams()
                .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                    + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionId + "."
                    + NAME_MTAS_TERMVECTOR_FUNCTION_EXPRESSION, null);
            functionTypes[tmpCounter][tmpSubFunctionCounter] = rb.req.getParams()
                .get(PARAM_MTAS_TERMVECTOR + "." + id + "."
                    + NAME_MTAS_TERMVECTOR_FUNCTION + "." + functionId + "."
                    + NAME_MTAS_TERMVECTOR_FUNCTION_TYPE, null);
            tmpSubFunctionCounter++;
          }
          boundaries[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
              + "." + id + "." + NAME_MTAS_TERMVECTOR_BOUNDARY, null);
          lists[tmpCounter] = rb.req.getParams().get(
              PARAM_MTAS_TERMVECTOR + "." + id + "." + NAME_MTAS_TERMVECTOR_LIST);
          listRegexps[tmpCounter] = rb.req.getParams()
              .getBool(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_LIST_REGEXP, false);
          ignoreRegexps[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
              + "." + id + "." + NAME_MTAS_TERMVECTOR_IGNORE_REGEXP, null);
          ignoreLists[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_TERMVECTOR
              + "." + id + "." + NAME_MTAS_TERMVECTOR_IGNORE_LIST, null);
          ignoreListRegexps[tmpCounter] = rb.req.getParams()
              .getBool(PARAM_MTAS_TERMVECTOR + "." + id + "."
                  + NAME_MTAS_TERMVECTOR_IGNORE_LIST_REGEXP, false);
          tmpCounter++;
        }
        String uniqueKeyField = rb.req.getSchema().getUniqueKeyField().getName();
        mtasFields.doTermVector = true;
        rb.setNeedDocSet(true);
        // init and checks
        for (String field : fields) {
          if (field == null || field.isEmpty()) {
            throw new IOException("no (valid) field in mtas termvector");
          } else if (!mtasFields.list.containsKey(field)) {
            mtasFields.list.put(field, new ComponentField(uniqueKeyField));
          }
        }
        MtasSolrResultUtil.compareAndCheck(keys, fields, NAME_MTAS_TERMVECTOR_KEY,
            NAME_MTAS_TERMVECTOR_FIELD, true);
        MtasSolrResultUtil.compareAndCheck(prefixes, fields,
            NAME_MTAS_TERMVECTOR_PREFIX, NAME_MTAS_TERMVECTOR_FIELD, false);
        MtasSolrResultUtil.compareAndCheck(regexps, fields,
            NAME_MTAS_TERMVECTOR_REGEXP, NAME_MTAS_TERMVECTOR_FIELD, false);
        MtasSolrResultUtil.compareAndCheck(types, fields,
            NAME_MTAS_TERMVECTOR_TYPE, NAME_MTAS_TERMVECTOR_FIELD, false);
        MtasSolrResultUtil.compareAndCheck(sortTypes, fields,
            NAME_MTAS_TERMVECTOR_SORT_TYPE, NAME_MTAS_TERMVECTOR_FIELD, false);
        MtasSolrResultUtil.compareAndCheck(sortDirections, fields,
            NAME_MTAS_TERMVECTOR_SORT_DIRECTION, NAME_MTAS_TERMVECTOR_FIELD,
            false);
        MtasSolrResultUtil.compareAndCheck(numbers, fields,
            NAME_MTAS_TERMVECTOR_NUMBER, NAME_MTAS_TERMVECTOR_FIELD, false);
        MtasSolrResultUtil.compareAndCheck(boundaries, fields,
            NAME_MTAS_TERMVECTOR_BOUNDARY, NAME_MTAS_TERMVECTOR_FIELD, false);
        MtasSolrResultUtil.compareAndCheck(lists, fields,
            NAME_MTAS_TERMVECTOR_LIST, NAME_MTAS_TERMVECTOR_FIELD, false);
        MtasSolrResultUtil.compareAndCheck(ignoreRegexps, fields,
            NAME_MTAS_TERMVECTOR_IGNORE_REGEXP, NAME_MTAS_TERMVECTOR_FIELD,
            false);
        MtasSolrResultUtil.compareAndCheck(ignoreLists, fields,
            NAME_MTAS_TERMVECTOR_IGNORE_LIST, NAME_MTAS_TERMVECTOR_FIELD, false);
        for (int i = 0; i < fields.length; i++) {
          if (!rb.req.getParams().getBool(ShardParams.IS_SHARD, false)) {
            numberShards[i] = null;
            boundaries[i] = null;
          }
          String field = fields[i];
          String prefix = (prefixes[i] == null) || (prefixes[i].isEmpty()) ? null
              : prefixes[i].trim();
          String key = (keys[i] == null) || (keys[i].isEmpty())
              ? String.valueOf(i) + ":" + field + ":" + prefix : keys[i].trim();
          String[] distanceKey = distanceKeys[i];
          String[] distanceType = distanceTypes[i];
          String[] distanceBase = distanceBases[i];
          Map<String, String>[] distanceParameter = distanceParameters[i];
          String[] distanceMinimum = distanceMinimums[i];
          String[] distanceMaximum = distanceMaximums[i];
          String regexp = (regexps[i] == null) || (regexps[i].isEmpty()) ? null
              : regexps[i].trim();
          Boolean full = (fulls[i] == null) || (!fulls[i].equals("true")) ? false
              : true;
          String startValue = (startValues[i] == null)
              || (startValues[i].isEmpty()) ? null : startValues[i].trim();
          int listNumber = (numbers[i] == null) || (numbers[i].isEmpty())
              ? DEFAULT_NUMBER : Integer.parseInt(numbers[i]);
          int numberFinal = (numberShards[i] == null)
              || (numberShards[i].isEmpty()) ? listNumber
                  : Integer.parseInt(numberShards[i]);
          String type = (types[i] == null) || (types[i].isEmpty()) ? null
              : types[i].trim();
          String sortType = (sortTypes[i] == null) || (sortTypes[i].isEmpty())
              ? null : sortTypes[i].trim();
          String sortDirection = (sortDirections[i] == null)
              || (sortDirections[i].isEmpty()) ? null : sortDirections[i].trim();
          String[] functionKey = functionKeys[i];
          String[] functionExpression = functionExpressions[i];
          String[] functionType = functionTypes[i];
          String boundary = boundaries[i];
          String[] list = null;
          Boolean listRegexp = listRegexps[i];
          if (lists[i] != null) {
            ArrayList<String> tmpList = new ArrayList<>();
            String[] subList = lists[i].split("(?<!\\\\),");
            for (int j = 0; j < subList.length; j++) {
              tmpList.add(subList[j].replace("\\,", ",").replace("\\\\", "\\"));
            }
            list = tmpList.toArray(new String[tmpList.size()]);
          }
          String ignoreRegexp = ignoreRegexps[i];
          String[] ignoreList = null;
          Boolean ignoreListRegexp = ignoreListRegexps[i];
          if (ignoreLists[i] != null) {
            ArrayList<String> tmpList = new ArrayList<>();
            String[] subList = ignoreLists[i].split("(?<!\\\\),");
            for (int j = 0; j < subList.length; j++) {
              tmpList.add(subList[j].replace("\\,", ",").replace("\\\\", "\\"));
            }
            ignoreList = tmpList.toArray(new String[tmpList.size()]);
          }
  
          if (prefix == null || prefix.isEmpty()) {
            throw new IOException("no (valid) prefix in mtas termvector");
          } else {
            try {
              mtasFields.list.get(field).termVectorList.add(
                  new ComponentTermVector(key, prefix, distanceKey, distanceType,
                      distanceBase, distanceParameter, distanceMinimum,
                      distanceMaximum, regexp, full, type, sortType,
                      sortDirection, startValue, numberFinal, functionKey,
                      functionExpression, functionType, boundary, list,
                      listRegexp, ignoreRegexp, ignoreList, ignoreListRegexp));
            } catch (ParseException e) {
              throw new IOException(e);
            }
          }
        }
  
      }
    }