I'm trying to build my own query. I want to combine several TermQuery
+ 1 PrefixQuery in a BooleanQuery. The Code looks like this:
BooleanQuery bq = new BooleanQuery();
Term t = new Term("field", "");
TermQuery tq = new TermQuery(t);
PrefixQuery pq = new PrefixQuery(t);
So bq is my customized BooleanQuery. Searching with this query results
in 0 hits. But working with QueryParser.parse()
and the parameter "foo AND bar*" results in a high number of hits.
Looking at the query string shows the same result
for the QueryParser querystring and the customized BooleanQuery
What could be the problem with my customized query?