Hi all,
I'm new to Lucene & have a quiestion about indexing the "contents" of files
& the use of the Highlighter.
I'm using Lucene 2.0.0.3 & Highlighter 2.0.0.1.
Based on the Test & Demo projects i've managed to get everything going just
fine except the ability to highlight the query string within a chunk of text
from the indexed contents.
The reason is the "contents" field doesn't actually store the text in the
index...
// Add the contents of the file to a field named "contents". Specify a
Reader,
// so that the text of the file is tokenized and indexed, but not stored.
// Note that FileReader expects the file to be in the system's default
encoding.
// If that's not the case searching for special characters will fail.
doc.Add(new Field("contents", new System.IO.StreamReader(f.FullName,
System.Text.Encoding.Default)));
So my question is whats the best way to get the text of a file into the
index so i can use the Highlighter on it?
Currently i've added another field & am using a parser class i found in an
earlier version of Lucene to get the text of the files into the index.
Is this still the best way to do it using Lucene 2.0.0.3 or is there a new
way?
Thanks,
Ken
_________________________________________________________________
Discover fun and games at @ http://xtramsn.co.nz/kids