On Dienstag, 26. August 2008, Andre Rubin wrote:

> Now I was the one who didn't follow: How do I add a query to an existing
> query?

Something like this should work:

BooleanQuery bq = new BooleanQuery();
PrefixQuery pq = new PrefixQuery(...);
bq.add(pq, BooleanClause.Occur.MUST);
TermQuery tq = new TermQuery(new Term("type", "sequence"));
bq.add(tq, BooleanClause.Occur.MUST);

bq is now the query you can use for searching. BooleanClause.Occur.MUST 
basically means "AND". So unless you want your users to access the 
features of Lucene's QueryParser (e.g. AND, OR, NOT, fuzzy queries etc) 
there's no need to use it.

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to