lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Indexing txt-files
Date Thu, 30 Oct 2003 09:09:34 GMT
I'm not an expert on Readers/InputStreams, but it sounds like you're 
dealing with a bug related to your usages of them and not Lucene.  Have 
a look at my Lucene Intro article where I use a FileReader.  Try a 
simple test using something like that eliminating as many variables as 
you can.

	Erik



On Thursday, October 30, 2003, at 03:41  AM, Günter Kukies wrote:

> Yes, i know that it is indexed and the contents is not stored. That is 
> what
> i want. But that means that I can search the index and i get back the
> lucene-document as a hit result with all the other fields(date,
> file-location,...)
> So my problem is that I don't get back the LUCENE-Document. Maby I 
> need a
> buffered reader or it is not allowed to close the reader.
>
> Günter
>
> ----- Original Message -----
> From: "Erik Hatcher" <erik@ehatchersolutions.com>
> To: "Lucene Users List" <lucene-user@jakarta.apache.org>
> Sent: Thursday, October 30, 2003 9:17 AM
> Subject: Re: Indexing txt-files
>
>
> Field.Text(String, Reader) is an unstored field.  It is indexed, but
> the contents are not stored in the index.
>
> If you want the contents stored, use Field.Text(String,String)
>
> Erik
>
> On Thursday, October 30, 2003, at 02:40  AM, Günter Kukies wrote:
>
>>  Hello,
>>
>> I  want to add a Text field to a LUCENE Document. I checked the index
>> with LUKE, but I don't get any results for search in the contents
>> Field. The test.txt is a simple ASCII-File. SimpleAnalyzer is used on
>> both sides search and index.
>>
>> Here are the relevant code snippets:
>>
>>
>> File file = new File("/documents/test.txt");
>>
>> addContent(document, new FileInputStream( file ));
>>
>>
>>  private static void addContent(Document document, InputStream is)
>> throws IOException {
>>         try {
>>             InputStreamReader input = new InputStreamReader(is);
>>             document.add(Field.Text("contents", input ));
>>          }
>>         catch(Exception ex) {
>>             ex.printStackTrace();
>>         }
>>         finally {
>>             if( is != null ) {
>>                 is.close();
>>             }
>>         }
>>     }
>>
>>
>> Thanks for your help
>>
>> Günter
>
> ---------------------------------------------------------------------
> 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


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