nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: svn commit: r405565 - in /lucene/nutch/trunk/src: java/org/apache/nutch/searcher/ test/org/apache/nutch/searcher/ web/jsp/
Date Tue, 09 May 2006 23:42:13 GMT
Thanks for making this change!

A few comments:

jerome@apache.org 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

Mime
View raw message