I think this is a great idea.
I've never used the Field.Keyword and Field.Text type methods because I
can never remember what their 3-boolean-argument equivalents are. I
always stick the constructor format in a comment somewhere and use it.
>>> Doug Cutting <[EMAIL PROTECTED]> 07/11/04 12:03PM >>>
Doug Cutting wrote:
> The calls would look like:
>
> new Field("name", "value", Stored.YES, Indexed.NO, Tokenized.YES);
>
> Stored could be implemented as the nested class:
>
> public final class Stored {
> private Stored() {}
> public static final Stored YES = new Stored();
> public static final Stored NO = new Stored();
> }
Actually, while we're at it, Indexed and Tokenized are confounded. A
single entry would be better, something like:
public final class Index {
private Index() {}
public static final Index NO = new Index();
public static final Index TOKENIZED = new Index();
public static final Index UN_TOKENIZED = new Index();
}
then calls would look like just:
new Field("name", "value", Store.YES, Index.TOKENIZED);
BTW, I think Stored would be better named Store too.
BooleanQuery's required and prohibited flags could get the same
treatment, with the addition of a nested class like:
public final class Occur {
private Occur() {}
public static final Occur MUST_NOT = new Occur();
public static final Occur SHOULD = new Occur();
public static final Occur MUST = new Occur();
}
and adding a boolean clause would look like:
booleanQuery.add(new TermQuery(...), Occur.MUST);
Then we can deprecate the old methods.
Comments?
Doug
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]