[opencms-dev] Lucene Search - Show some text of the document
Oliver Mauckner
Oliver.Mauckner at sattelmacher.com
Tue Sep 9 12:29:01 CEST 2003
Hello
I want some text of the found files to be shown in my search results!
Here is part of my search.jsp
for(i = 0; i<j; ++i) {
score = hits.score(i);
doc = hits.doc(i);
String lms = doc.get("last_modified");
if(lms != null && !"".equals(lms))
tLastMod = DateField.stringToDate(lms).toString();
else tLastMod = "unknown";
//tLastMod = "unknown";
out.println("<p class=\"search-hit\"><b
class=\"search-hit-title\">"
+ "<a href=\"" + cms.link(doc.get("abs_path")) + "\"
class=\"search-hit-link\">"
+ doc.get("title") + "</a></b><br><i
class=\"search-hit-score\">");
//out.print(score); // Score is between 0.0 and 1.0
out.println("</i> " + doc.get("description") + " <br><span
class=\"smalltext\">(Last modified: " + tLastMod + ")</span></p>");
}
Does anybody know why my score is not working?
There is only null shown in the results!
There has to be a function to get some text of the found document!
Thanx
Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20030909/560802f2/attachment.htm>
More information about the opencms-dev
mailing list