@Test public void shouldParseStringWithTwoANDedUnquotedTermsORedWithMultipleUnquotedTerms() { Term result = parser.parse("term1 term2 OR -term3 OR -term4 OR term5"); assertThat(result, is(notNullValue())); assertThat(result, is(instanceOf(Disjunction.class))); Disjunction disjunction = (Disjunction)result; assertThat(disjunction.getTerms().size(), is(4)); Conjunction conjunction1 = (Conjunction)disjunction.getTerms().get(0); Term term3 = disjunction.getTerms().get(1); Term term4 = disjunction.getTerms().get(2); Term term5 = disjunction.getTerms().get(3); assertHasSimpleTerms(conjunction1, "term1", "term2"); assertSimpleTerm(term3, "term3", true, false); assertSimpleTerm(term4, "term4", true, false); assertSimpleTerm(term5, "term5", false, false); }
public Term parse( String fullTextSearchExpression ) { CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression"); Tokenizer tokenizer = new TermTokenizer(); TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false); return parse(stream.start()); }
FullTextSearchParser implements QueryParser { public Term parse( String fullTextSearchExpression ) { CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression"); Tokenizer tokenizer = new TermTokenizer(); TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false); return parse(stream.start()); } }
FullTextSearchParser implements QueryParser { public Term parse( String fullTextSearchExpression ) { CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression"); Tokenizer tokenizer = new TermTokenizer(); TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false); return parse(stream.start()); }  }
FullTextSearchParser implements QueryParser { public Term parse( String fullTextSearchExpression ) { CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression"); Tokenizer tokenizer = new TermTokenizer(); TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false); return parse(stream.start()); }  @Override String getLanguage(); @Override QueryCommand parseQuery( String query,
                                    TypeSystem typeSystem ); Term parse( String fullTextSearchExpression ); Term parse( TokenStream tokens ); }
FullTextSearchParser implements QueryParser { public Term parse( String fullTextSearchExpression ) { CheckArg.isNotNull(fullTextSearchExpression, "fullTextSearchExpression"); Tokenizer tokenizer = new TermTokenizer(); TokenStream stream = new TokenStream(fullTextSearchExpression, tokenizer, false); return parse(stream.start()); }  @Override String getLanguage(); @Override QueryCommand parseQuery( String query,
                                    TypeSystem typeSystem ); Term parse( String fullTextSearchExpression ); Term parse( TokenStream tokens ); static final String LANGUAGE; }