lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Messer <Bernhard.Mes...@intrafind.de>
Subject Re: API cleanup for Field and future cleanup for IndexReader
Date Sat, 16 Oct 2004 20:38:10 GMT
hi all,

i found this mail per accident in my mailbox between all the other 
thousands of lucene mails ;-). Looking at the original proposal and the 
code situation today (6 weeks after the inital mail), it would even make 
more sense to cleanup IndexReader. There is a 4th method now in 
IndexReader getIndexedFieldNames(Field.TermVector tvSpec) which does 
something similar than the 3 other methods mentioned below.

What do others think (Christoph already voted +1). If accepted, i could 
try to prepare a patch packing everything in a single method.

regards
Bernhard

Christoph Goller wrote:

> Bernhard Messer wrote:
>
>> hi all,
>>
>> Daniel did a great job when cleaning up the Field class to make it 
>> more readable for the user. Wouldn't it be the best time to clean up 
>> the 3 IndexReader methods which are directly related to field names ? 
>> Currently there are 3 different methods available to get the field 
>> names from an index.
>>
>> a) getFieldNames();
>> b) getFieldNames(boolean indexed);
>> c) getIndexedFieldNames(boolean storedTermVector);
>>
>> my proposal is to deprecate a), b) and c) and add one new method 
>> which can handle all the possible options. The implementation could 
>> be similar to the new Store, Index etc. implementation in Field 
>> class. Adding a public static final class to IndexReader like:
>>
>> public static final class FieldNames {
>>    private String option;
>>    private FieldNames() {}
>>    private FieldNames(String option) {
>>      this.option = option;
>>    }
>>    public String toString() {
>>      return option;
>>    }
>>      public static final FieldNames ALL = new FieldNames ("ALL");
>>    public static final FieldNames INDEXED = new FieldNames ("INDEXED");
>>    ....
>>  }
>>
>> we would end up with a method like:
>>
>> getFieldNames(FieldNames names);
>>
>> any thoughts on it ?
>
>
> +1
> seems reasonable for me.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message