String docClass = dprops.getProperty(ftype);
if ( (docClass == null) || (docClass.equals("")) ) docClass = "org.sf.mustru.docs.TextDoc";
Class docType = Class.forName(docClass);
results[j++] = " Hit: " + i + ". Type: " + docClass + " Key: " + key + " Score: " + hits.score(i);
IndexableDoc idoc = (IndexableDoc) docType.newInstance();
idoc = (IndexableDoc) idoc.getBdbBinding().entryToObject(data);
String contents = idoc.getContents().toString(); contents = StringTools.filterChars(contents);
contents = StringTools.fillin(contents, 800, '.');
results[j++] = " File Name: " + idoc.getFileName();
results[j++] = " File Location: " + idoc.getFileLocation();
results[j++] = " File Type: " + idoc.getFileType();
Method method = idoc.getClass().getMethod("getTextType", new Class[] {} ); method.setAccessible(true);
results[j++] = " Text type: " + (String) method.invoke(idoc, new Object[] {} );
results[j++] = " File Size: " + idoc.getFileLength();
results[j++] = " File Rank: " + idoc.getFileRank();
results[j++] = " Title: " + idoc.getTitle();
results[j++] = " Author: " + idoc.getAuthor();
results[j++] = " Language: " + idoc.getLanguage();
j = dumpResults(contents, j);
results[j++] = "";
if (explain)
{ Explanation exp = is.explain(query, hits.id(i));
results[j++] = " Explanation: " + exp; }