lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <daniel.na...@t-online.de>
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:

http://www.mail-archive.com/lucene-user%40jakarta.apache.org/msg08479.html

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.

Regards
 Daniel

-- 
http://www.danielnaber.de

Mime
View raw message