code: protected CoordinateSearchMetadata.Action recordMetadata(FilterJoinNode node, FilterJoinNode parent) {
      FilterJoinTerms terms = node.getTerms();
  
      final String[] fromIndices = node.getLookupIndices();
      final String[] fromTypes = node.getLookupTypes();
      final String[] toIndices = parent == null ? null : parent.getLookupIndices();
      final String[] toTypes = parent == null ? null : parent.getLookupTypes();
  
      CoordinateSearchMetadata.Relation from = new CoordinateSearchMetadata.Relation(fromIndices, fromTypes, node.getLookupPath());
      CoordinateSearchMetadata.Relation to = new CoordinateSearchMetadata.Relation(toIndices, toTypes, node.getField());
  
      CoordinateSearchMetadata.Action action = this.metadata.addAction(from, to);
      action.setPruned(terms.isPruned());
      action.setSize(terms.getSize());
      action.setSizeInBytes(terms.getEncodedTerms().length);
      action.setCacheHit(terms.cacheHit());
      action.setTookInMillis(terms.getTookInMillis());
      action.setTermsEncoding(node.getTermsEncoding());
      action.setOrdering(node.getOrderBy());
      action.setMaxTermsPerShard(node.getMaxTermsPerShard());
  
      return action;
    }
docs: Records metadata of each terms by query actions. This must be called before
  converting the filter join into a field data terms query.
  <br>
  Returns the created action, so that subclasses, e.g., {@link CachedFilterJoinVisitor}, can extend it.