code: public static void collectField(String field, IndexSearcher searcher,
        IndexReader rawReader, ArrayList<Integer> fullDocList,
        ArrayList<Integer> fullDocSet, ComponentField fieldStats, Status status)
        throws IllegalAccessException, IllegalArgumentException,
        InvocationTargetException, IOException {
      if (fieldStats != null) {
        IndexReader reader = searcher.getIndexReader();
        HashMap<MtasSpanQuery, SpanWeight> spansQueryWeight = new HashMap<>();
        // only if spanQueryList is not empty
        if (fieldStats.spanQueryList.size() > 0) {
          final float boost = 0;
          for (MtasSpanQuery sq : fieldStats.spanQueryList) {
            spansQueryWeight.put(sq, ((MtasSpanQuery) sq.rewrite(reader))
                .createWeight(searcher, false, boost));
          }
        }
        // collect
        CodecCollector.collectField(field, searcher, reader, rawReader,
            fullDocList, fullDocSet, fieldStats, spansQueryWeight, status);
      }
    }
docs: Collect field.
  
  @param field
  the field
  @param searcher
  the searcher
  @param rawReader
  the raw reader
  @param fullDocList
  the full doc list
  @param fullDocSet
  the full doc set
  @param fieldStats
  the field stats
  @throws IllegalAccessException
  the illegal access exception
  @throws IllegalArgumentException
  the illegal argument exception
  @throws InvocationTargetException
  the invocation target exception
  @throws IOException
  Signals that an I/O exception has occurred.