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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org