Thanks for making this change!
A few comments:
[EMAIL PROTECTED] wrote:
==============================================================================
---
lucene/nutch/trunk/src/java/org/apache/nutch/searcher/OpenSearchServlet.java
(original)
+++
lucene/nutch/trunk/src/java/org/apache/nutch/searcher/OpenSearchServlet.java
Tue May 9 16:04:40 2006
[...]
- addNode(doc, item, "description", summaries[i]);
+ addNode(doc, item, "description", summaries[i].toString());
This means there's no markup in the OpenSearch output?
Shouldn't there be?
Modified: lucene/nutch/trunk/src/web/jsp/search.jsp
URL:
http://svn.apache.org/viewcvs/lucene/nutch/trunk/src/web/jsp/search.jsp?rev=405565&r1=405564&r2=405565&view=diff
==============================================================================
+
+ // Build the summary
+ StringBuffer sum = new StringBuffer();
+ Fragment[] fragments = summaries[i].getFragments();
+ for (int j=0; j<fragments.length; j++) {
+ if (fragments[j].isHighlight()) {
+ sum.append("<span class=\"highlight\">")
+ .append(Entities.encode(fragments[j].getText()))
+ .append("</span>");
+ } else if (fragments[j].isEllipsis()) {
+ sum.append("<span class=\"ellipsis\"> ... </span>");
+ } else {
+ sum.append(Entities.encode(fragments[j].getText()));
+ }
+ }
+ String summary = sum.toString();
Perhaps this should be a method on Summary, to render it as html?
Doug