lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: Exception, field is not stored
Date Tue, 13 Apr 2010 14:16:34 GMT

On Apr 12, 2010, at 1:31 PM, Ramon De Paula Marques wrote:

> Hi guys,
> 
> I'm trying to use highlighter to a better search on my website, but when the
> search get documents html and pdf that were indexed with a reader causes an
> exception that tells the field is not stored.
> 
> I don't know where to attack now, i must try to index documents storing
> fields? How to do it, for html it is storing automatically
> i can't set new Field(..., Field.Store.Yes) it is like this:
>    FileInputStream fis = new FileInputStream(f);
>    HTMLParser parser = new HTMLParser(fis);
>    doc.add(new Field("contents", parser.getReader()));
> 
> and for pdf, it is indexing like this:
> InputStream fis = new FileInputStream(inputFile);
>        Document luceneDocument = LucenePDFDocument.getDocument(
> fis);
>        writer.addDocument(luceneDocument);
> 
> 


You need to use the Field constructor that takes in a String and not a Reader in order to
use storage.

--------------------------
Grant Ingersoll
http://www.lucidimagination.com/

Search the Lucene ecosystem using Solr/Lucene: http://www.lucidimagination.com/search


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


Mime
View raw message