ArrayList results = new ArrayList();
IndexReader reader = IndexReader.open(storeIndex);
Searcher searcher = new IndexSearcher(reader);
Analyzer analyzer = new StandardAnalyzer();
Query query = QueryParser.parse(item,"TextPath",analyzer);
Hits hits = searcher.search(query);
for(int i = 0; i < hits.length() && i < QueryManager.resultSize; i++){
Document doc = hits.doc(i);
String path = doc.get("Path");
if(!results.contains(path))
results.add(path);
}
if(content){
query = QueryParser.parse(item, "Contents", analyzer);
hits = searcher.search(query);
for (int i = 0; i < hits.length() && i < QueryManager.resultSize; i++) {
Document doc = hits.doc(i);
String path = doc.get("Path");
if (!results.contains(path))
results.add(path);
}
query = QueryParser.parse(item, "ExtendedInfosContent", analyzer);
hits = searcher.search(query);
for (int i = 0; i < hits.length() && i < QueryManager.resultSize; i++) {
Document doc = hits.doc(i);
String path = doc.get("Path");
if (!results.contains(path))
results.add(path);
}
}
query = QueryParser.parse(item,"PartialFileName",analyzer);
hits = searcher.search(query);
for(int i = 0; i < hits.length() && i < QueryManager.resultSize; i++){
Document doc = hits.doc(i);
StringHash hash = new StringHash(doc.get("PartialFileHash"));
if(!results.contains(hash))
results.add(hash);
}
reader.close();