lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Reader in lucene's Text Field type and in java
Date Fri, 30 Apr 2004 12:52:20 GMT
On Apr 30, 2004, at 5:19 AM, jitender ahuja wrote:
> Hi,
>        Can anyone tell if the two : Reader in lucene's as Text Field 
> type and the Reader class in java are the same and if yes, why so?
> Also, if they are the same then does one must take the data input(even 
> if from a XML Document from a database) from a Reader class or its 
> relevant subclass.

The Text field also takes a String in an overloaded signature.

Yes, Reader is a java.io.Reader.  Why?  I guess my question is "why 
not?".

So yes, you must feed text into Lucene either as a String or, if the 
Text field w/ Reader fits what you want that field to do, with a 
Reader.  Keep in mind that using Field.Text with a Reader is a slightly 
different than Field.Text with a String.  The Reader one does _not_ 
store the contents in the index - it indexes and tokenizes, but does 
not store.  The reasoning, I presume, for this is that text coming from 
a Reader is going to be larger than just a String and you would likely 
not want to store it anyway.

	Erik


---------------------------------------------------------------------
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