public Term parse ( TokenStream tokens ) { CheckArg . isNotNull ( tokens , "tokens" ) ; List < Term > terms = new ArrayList < Term > ( ) ; do { Term term = parseDisjunctedTerms ( tokens ) ; if ( term == null ) break ; terms . add ( term ) ; } while ( tokens . canConsume ( "OR" ) ) ; if ( terms . isEmpty ( ) ) return null ; return terms . size ( ) > 1 ? new Disjunction ( terms ) : terms . iterator ( ) . next ( ) ; }
Parse the full - text search criteria from the supplied token stream . This method is useful when the full - text search expression is included in other content .