Hi!
I need some information about PhraseQuery Class.
How to use this class ?
I tried to use, but I couldn't.
I created an index, just with 2 fields:
- path: path of the file
- contents: the text of the file (pdf,txt,html,doc,rtf ...)
I want to search with phrases... Is it possible ?
This is te code...
public void indexFiles(String filePath, String documentText, String
indexName, boolean create) {
try {
IndexWriter writer = null;
File index = new File ("./" + indexName);
if (!index.exists()) {
writer = new IndexWriter(indexName, null, true);
writer.optimize();
writer.close();
}
writer = new IndexWriter(indexName, new StandardAnalyzer(), false);
Document doc = new Document();
doc.add(Field.UnIndexed ("path",filePath));
doc.add(Field.Text("contents",documentText));
writer.addDocument(doc);
doc = null;
writer.close();
}
catch (Exception ex) {
System.out.println("Error - " + ex);
}
}
Thanks!
Regards.
--
Daniel de Souza Teixeira
Laborat�rio de Inova��o em Software - Unicamp/Ci&T
Campinas-SP
Brasil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]