From e70311f3860158dc6d12c7a5e03714cc830d1e6a Mon Sep 17 00:00:00 2001 From: "Chris M. Hostetter" Date: Fri, 28 Jan 2011 00:34:40 +0000 Subject: [PATCH] SOLR-2085: Improve SolrJ behavior when FacetComponent comes before QueryComponent git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1064386 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 4 ++++ .../org/apache/solr/client/solrj/response/QueryResponse.java | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 7285ed6b69e..f30713d253a 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -166,6 +166,10 @@ Bug Fixes * SOLR-2320: Fixed ReplicationHandler detail reporting for masters (hossman) +* SOLR-2085: Improve SolrJ behavior when FacetComponent comes before + QueryComponent (Tomas Salfischberger via hossman) + + Other Changes ---------------------- diff --git a/solr/src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java b/solr/src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java index c80334070af..f1259d1ccbc 100644 --- a/solr/src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java +++ b/solr/src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java @@ -105,7 +105,8 @@ public class QueryResponse extends SolrResponseBase } else if( "facet_counts".equals( n ) ) { _facetInfo = (NamedList) res.getVal( i ); - extractFacetInfo( _facetInfo ); + // extractFacetInfo inspects _results, so defer calling it + // in case it hasn't been populated yet. } else if( "debug".equals( n ) ) { _debugInfo = (NamedList) res.getVal( i ); @@ -128,6 +129,7 @@ public class QueryResponse extends SolrResponseBase extractTermsInfo( _termsInfo ); } } + if(_facetInfo != null) extractFacetInfo( _facetInfo ); } private void extractSpellCheckInfo(NamedList> spellInfo) {