lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <>
Subject API cleanup: BooleanQuery.add()
Date Thu, 19 Aug 2004 22:48:46 GMT

BooleanQuery.add() currently takes two boolean values. That's difficult to 
use as these two parameters can easily be confused. Also, there's a 
runtime error if one uses true for both parameters. Thus this method's API 
should be redesigned. It has been discussed here already:

I suggest the attached patch. Instead of Doug's suggestion of "Occur" my 
patch uses "Operator" and instead of MUST/MUST_NOT/SHOULD it uses 
AND/NOT/OR for the enumeration. I think SHOULD would be difficult to 
understand, but I'm not happy with OR either. The problem is that it's 
okay to have a BooleanQuery with only one Term, and OR would mean the same 
as AND in that case.

Please post your suggestions for better names.



View raw message