You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2010/09/15 01:16:32 UTC

[jira] Commented: (SOLR-2121) distributed highlighting using q.alt=*:* causes NPE in finishStages

    [ https://issues.apache.org/jira/browse/SOLR-2121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909514#action_12909514 ] 

Hoss Man commented on SOLR-2121:
--------------------------------

Marc Sturlese posted his "fix" but it's not entirely obvious to me what exactly the necessary change is, or if the root cause isn't somewhere else...

{code}
  public void finishStage(ResponseBuilder rb) {
    boolean hasHighlighting = true ;
    if (rb.doHighlights && rb.stage == ResponseBuilder.STAGE_GET_FIELDS) {

      Map.Entry<String, Object>[] arr = new
NamedList.NamedListEntry[rb.resultIds.size()];

      // TODO: make a generic routine to do automatic merging of id keyed
data
      for (ShardRequest sreq : rb.finished) {
        if ((sreq.purpose & ShardRequest.PURPOSE_GET_HIGHLIGHTS) == 0)
continue;
        for (ShardResponse srsp : sreq.responses) {
          NamedList hl =
(NamedList)srsp.getSolrResponse().getResponse().get("highlighting");
          //patch bug
          if(hl != null) {
            for (int i=0; i<hl.size(); i++) {
             String id = hl.getName(i);
             ShardDoc sdoc = rb.resultIds.get(id);
             int idx = sdoc.positionInResponse;
             arr[idx] = new NamedList.NamedListEntry(id, hl.getVal(i));
            }
          } else {
            hasHighlighting = false;
          }
        }
      }

      // remove nulls in case not all docs were able to be retrieved
      //patch bug
      if(hasHighlighting) {
        rb.rsp.add("highlighting", removeNulls(new SimpleOrderedMap(arr)));
      }
    }
  }

{code}

> distributed highlighting using q.alt=*:* causes NPE in finishStages
> -------------------------------------------------------------------
>
>                 Key: SOLR-2121
>                 URL: https://issues.apache.org/jira/browse/SOLR-2121
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Hoss Man
>
> As noted on the mailing list by Ron Mayer,  using the example configs and example data on trunk, this query works...
> http://localhost:8983/solr/select?q.alt=*:*&hl=on&defType=edismax
> ...but this query causes and NullPointerException...
> http://localhost:8983/solr/select?q.alt=*:*&hl=on&defType=edismax&shards=localhost:8983/solr
> Stack Trace...
> {noformat}
> java.lang.NullPointerException
> 	at org.apache.solr.handler.component.HighlightComponent.finishStage(HighlightComponent.java:158)
> 	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:310)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1324)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:337)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:240)
> 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org