private Query analyzeBoolean(String field,TokenStream stream) throws IOException {
  TermToBytesRefAttribute termAtt=stream.getAttribute(TermToBytesRefAttribute.class);
  stream.reset();
  List<Term> terms=new ArrayList<>();
  while (stream.incrementToken()) {
    terms.add(new Term(field,termAtt.getBytesRef()));
  }
  return newSynonymQuery(terms.toArray(new Term[terms.size()]));
}

private Query analyzeBoolean ( String field , TokenStream stream ) throws IOException { TermToBytesRefAttribute termAtt = stream . getAttribute ( TermToBytesRefAttribute . class ) ; stream . reset ( ) ; List < Term > terms = new ArrayList < > ( ) ; while ( stream . incrementToken ( ) ) { terms . add ( new Term ( field , termAtt . getBytesRef ( ) ) ) ; } return newSynonymQuery ( terms . toArray ( new Term [ terms . size ( ) ] ) ) ; }
creates simple boolean query from the cached tokenstream contents
