1 Jun 2010 02:29
Re: NPE error when extending DefaultSolrHighlighter
Koji Sekiguchi <koji <at> r.email.ne.jp>
2010-06-01 00:29:40 GMT
2010-06-01 00:29:40 GMT
(10/06/01 6:45), Gerald wrote:
> I was looking at solr-386 and thought I would try to create a custom
> highlighter for something I was doing.
>
> I created a class that looks something like this:
>
> public class CustomOutputHighlighter extends DefaultSolrHighlighter {
> <at> Override
> public NamedList doHighlighting(DocList docs, Query query,
> SolrQueryRequest req, String[] defaultFields) throws IOException {
> NamedList highlightedValues = super.doHighlighting(docs,
> query, req, defaultFields);
>
> // do more stuff here
>
> return highlightedValues
> }
> }
>
> and have replaced the<highlighting> line in my solrconfig xml so that it
> looks something like this:
>
> <highlighting class="com.xxxxxxx.solr.highlight.CustomOutputHighlighter">
>
> and left all the existing default highlighting parameters as-is
>
> The code compiles with no problem, and should simply perform the normal
> highlighting (since all I am doing is calling the original doHighlighting
> code and returning the results). However, when I start Solr, I get an NPE
> error:
(Continue reading)
RSS Feed