lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günter Kukies <guenter.kuk...@heuft.com>
Subject Re: Indexing txt-files
Date Thu, 30 Oct 2003 12:40:49 GMT
Hi,

is it possible to upgrade the API-doc, that a Buffered Reader is a must.

Who is responsible for closing the InputStream? Does doc.add() the close?

Günter


----- Original Message -----
From: "Erik Hatcher" <erik@ehatchersolutions.com>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Thursday, October 30, 2003 1:19 PM
Subject: Re: Indexing txt-files


> Strange.  FileReader works fine in my java.net article code.
>
>
> On Thursday, October 30, 2003, at 06:35  AM, Otis Gospodnetic wrote:
>
> > This is from Lucene demo, included in Lucene distribution.
> > Look at FileDocument class:
> >
> >     // Add the contents of the file a field named "contents".  Use a
> > Text
> >     // field, specifying a Reader, so that the text of the file is
> > tokenized.
> >     // ?? why doesn't FileReader work here ??
> >     FileInputStream is = new FileInputStream(f);
> >     Reader reader = new BufferedReader(new InputStreamReader(is));
> >     doc.add(Field.Text("contents", reader));
> >
> > Otis
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>


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


Mime
View raw message