retstr += readers.size() + " readers obtained\n";
for (int readerid = 0; readerid < readers.size(); readerid++)
{
retstr += "reader: " + readerid + "\n";
docstr += "reader: " + readerid + "\n";
ZoieIndexReader reader = readers.get(readerid);
DocIDMapper idmapper = reader.getDocIDMaper();
try
{
Collection fieldnames = reader.getFieldNames(FieldOption.ALL);
String fieldnamess = Arrays.toString(fieldnames.toArray());
retstr += "fields: " + fieldnamess + "\n";
searcher = new IndexSearcher(reader);
TopDocs hits = searcher.search(q, 10);
String docs = "";
for (int i = 0; i < hits.scoreDocs.length; i++)
{
int docid = hits.scoreDocs[i].doc;
float score = hits.scoreDocs[i].score;
Explanation exp = searcher.explain(q, docid);
Document doc = reader.document(docid);
long uid = reader.getUID(docid);
docs = docs + "UID: " + formatter.format(uid) + "\ndocid(in reader): " + formatter.format(docid) + "\nscore: " + score + "\n\n";
docstr = docstr + "UID: " + formatter.format(uid) + "\ndocid(in reader): " + formatter.format(docid) + "\nscore: " + score + "\n" + doc + "\n" + exp + "\n\n";
}
retstr += hits.totalHits + " hits returned\n" + docs + "\n";
} finally