lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Carvalho <>
Subject Differences between BooleanQuery and QueryParser
Date Mon, 30 Jan 2012 21:55:00 GMT
Is there any difference, from a performance standpoint (or any other
standpoint whatsoever), between instantiating a query using QueryParser and
BooleanQuery? Is either of them preferable to use?


QueryParser parser = new QueryParser(Version.LUCENE_33, "name", wrapper)
Query query = parser.parse("size:small AND color:blue")


BooleanQuery skuQuery = new BooleanQuery();
skuQuery.add(new TermQuery(new Term("size", "small")), Occur.MUST);
skuQuery.add(new TermQuery(new Term("color", "blue")), Occur.MUST);


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message