Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 34249 invoked from network); 20 Oct 2010 07:53:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Oct 2010 07:53:49 -0000 Received: (qmail 29674 invoked by uid 500); 20 Oct 2010 07:53:48 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 29523 invoked by uid 500); 20 Oct 2010 07:53:48 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 29478 invoked by uid 99); 20 Oct 2010 07:53:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Oct 2010 07:53:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Oct 2010 07:53:45 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9K7rORc019492 for ; Wed, 20 Oct 2010 07:53:24 GMT Message-ID: <14642932.5101287561204422.JavaMail.jira@thor> Date: Wed, 20 Oct 2010 03:53:24 -0400 (EDT) From: "Marc Sturlese (JIRA)" To: dev@lucene.apache.org Subject: [jira] Closed: (SOLR-1901) bug using distributed search, highlighting and q.alt In-Reply-To: <6096532.15381272901856508.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SOLR-1901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marc Sturlese closed SOLR-1901. ------------------------------- Resolution: Fixed Fix Version/s: (was: Next) 3.1 > bug using distributed search, highlighting and q.alt > ---------------------------------------------------- > > Key: SOLR-1901 > URL: https://issues.apache.org/jira/browse/SOLR-1901 > Project: Solr > Issue Type: Bug > Components: SearchComponents - other > Affects Versions: 1.5 > Reporter: Marc Sturlese > Priority: Minor > Fix For: 3.1 > > > I have noticed when using q.alt even if hl=true highlights are not returned. > When using distributed search, q.alt and hl, HighlightComponent.java > finishStage expects the highlighting NamedList of each shard (if hl=true) > but it will never be returned. It will end up with a NullPointerExcepion. > I have temporally solved it checking that highlight NamedList is always > returned for each shard. If it's not the case, highlights are not added to > the response: > @Override > public void finishStage(ResponseBuilder rb) { > boolean hasHighlighting = true ; > if (rb.doHighlights && rb.stage == ResponseBuilder.STAGE_GET_FIELDS) { > Map.Entry[] 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"); > if(hl != null) { > for (int i=0; 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 > if(hasHighlighting) { > rb.rsp.add("highlighting", removeNulls(new SimpleOrderedMap(arr))); > } > } > } -- 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