Thursday, 15 August 2013

Specify document Fields using Lucene library

Specify document Fields using Lucene library

I'm using lucene library to create an index from a number of documents.
For example, the name of the first document is file1.txt and it contains
the following text:
.T (title of the document) .A (author of the document) .S (summary of the
document)
If i want define as Field all the contents fo the document i'm writing
this: doc.add(new TextField("contents", new BufferedReader( new
InputStreamReader(fis, "UTF-8"))));
What if i want to specify only the summary of the document as a Field? Im
new to java and i can't find a way.

No comments:

Post a Comment