Results 1 to 1 of 1
Thread: Term Vector files situation
- 03-22-2012, 12:17 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 1
- Rep Power
- 0
Term Vector files situation
Hey all,
i'm in my first steps in Lucene.
I was trying to index some txt files, and my program doesn't construct the term vector files. I would need these files. (.tvd, .tvx, .tvf)
I'm attaching my code so anyone can help me.
Thank you all in advance!
Sorry if i'm repeating the question, but i couldn't find the answer to it.
public void indexFileOrDirectory(String fileName) throws IOException {
addFiles(new File(fileName));
int originalNumDocs = writer.numDocs();
for (File f : queue) {
FileReader fr = null;
try {
Document doc = new Document();
fr = new FileReader(f);
doc.add(new Field("contents", fr));
doc.add(new Field("path", fileName, Field.Store.YES, Field.Index.NOT_ANALYZED));
String xpto = "xpto1 xpto2 xpto3";
doc.add(new Field("contents2", xpto, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));
writer.addDocument(doc);
System.out.println("Added: " + f);
} catch (Exception e) {
System.out.println("Could not add: " + f);
} finally {
fr.close();
}
Similar Threads
-
Getting the term object from a string.
By koolmelee in forum LuceneReplies: 1Last Post: 09-17-2011, 06:59 PM -
Number of searched term in Documents
By MrUni in forum LuceneReplies: 0Last Post: 12-14-2010, 03:00 PM -
simple question: A multithread situation
By simorgh in forum Threads and SynchronizationReplies: 1Last Post: 01-13-2010, 08:25 PM -
What should the program look like for this situation
By megironi in forum New To JavaReplies: 4Last Post: 02-22-2009, 11:16 AM -
StringBuffer situation
By orchid in forum New To JavaReplies: 6Last Post: 08-12-2008, 01:39 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks