code: @Override
    public Query parse() throws SyntaxError {
      if (id == null) {
        throw new SyntaxError("no " + MTAS_JOIN_QPARSER_COLLECTION);
      } else if (fields == null) {
        throw new SyntaxError("no " + MTAS_JOIN_QPARSER_FIELD);
      } else {
  
        BooleanQuery.Builder booleanQueryBuilder = new BooleanQuery.Builder();
  
        MtasSolrCollectionCache mtasSolrJoinCache = null;
        for (PluginHolder<SearchComponent> item : req.getCore()
            .getSearchComponents().getRegistry().values()) {
          if (item.get() instanceof MtasSolrSearchComponent) {
            mtasSolrJoinCache = ((MtasSolrSearchComponent) item.get())
                .getCollectionCache();
          }
        }
        if (mtasSolrJoinCache != null) {
          Automaton automaton;
          try {
            automaton = mtasSolrJoinCache.getAutomatonById(id);
            if (automaton != null) {
              for (String field : fields) {
                booleanQueryBuilder.add(
                    new AutomatonQuery(new Term(field), automaton), Occur.SHOULD);
              }
            } else {
              throw new IOException("no data for collection '" + id + "'");
            }
          } catch (IOException e) {
            throw new SyntaxError(
                "could not construct automaton: " + e.getMessage(), e);
          }
          return booleanQueryBuilder.build();
        } else {
          throw new SyntaxError("no MtasSolrSearchComponent found");
        }
      }
    }
docs: /*
  (non-Javadoc)
  
  @see org.apache.solr.search.QParser#parse()