@Test public void shouldParseStringWithMultipleUnquotedANDedTermsORedTogether() { Term result = parser.parse("term1 term2 OR -term3 -term4"); assertThat(result, is(notNullValue())); assertThat(result, is(instanceOf(Disjunction.class))); Disjunction disjunction = (Disjunction)result; assertThat(disjunction.getTerms().size(), is(2)); Conjunction conjunction1 = (Conjunction)disjunction.getTerms().get(0); Conjunction conjunction2 = (Conjunction)disjunction.getTerms().get(1); assertHasSimpleTerms(conjunction1, "term1", "term2"); assertHasSimpleTerms(conjunction2, "-term3", "term4"); }
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; }