You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Doug Cutting <cu...@apache.org> on 2004/09/01 21:55:18 UTC

Re: API cleanup for Field

Daniel Naber wrote:
> Okay, but the Field.Text that takes a Reader doesn't seem to be a pure 
> convenience method, it makes use of the Reader, doesn't it? So to keep 
> that feature we probably need another public constructor just like the 
> current one with parameters name, value, and with two resp. three 
> enumerations, but it needs to take a Reader instead of a String. Is that 
> correct?

That's right.  In particular I think we'll need:

  public Field(String, Reader, Index); // Reader is never stored
  public Field(String, Reader, Index, TermVector);

Doug

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


Re: API cleanup for Field

Posted by Christoph Goller <go...@detego-software.de>.
Daniel Naber wrote:
> On Wednesday 01 September 2004 21:55, Doug Cutting wrote:
> 
> 
>>That's right.  In particular I think we'll need:
>>
>>  public Field(String, Reader, Index); // Reader is never stored
> 
> 
> Actually you'll also get an exception when you try to index the field 
> UN_TOKENIZED. I didn't check what exactly happens in that case, for now I 
> just left out the "Index" parameter, too (i.e. default to TOKENIZE).

A field with Reader value cannot be stored, as Doug said, since some
Readers (e.g. PipedReader) do not support reset and FieldsWriter would
consume such a Reader in order to store the field. After storing, indexing
would then no longer be possible.

DocumentWriter could probably be changed to allow UN_TOKENIZED fields
with ReaderValue, but that's probably not necesary, since a ReaderValue
is something supposed to be quite long and so not tokenizing it does not
make much sense.

Internally Field still uses the boolean values isStored, isIndexed,
isTokenized, and storeTermVector. And there are public getters for them.
Shouldn't we substitute them totally with the respective enums?

Christoph


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


Re: API cleanup for Field

Posted by Daniel Naber <da...@t-online.de>.
On Wednesday 01 September 2004 21:55, Doug Cutting wrote:

> That's right.  In particular I think we'll need:
>
>   public Field(String, Reader, Index); // Reader is never stored

Actually you'll also get an exception when you try to index the field 
UN_TOKENIZED. I didn't check what exactly happens in that case, for now I 
just left out the "Index" parameter, too (i.e. default to TOKENIZE).

Regards
 Daniel

-- 
http://www.danielnaber.de

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