You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jan Høydahl (JIRA)" <ji...@apache.org> on 2017/05/21 22:23:04 UTC
[jira] [Closed] (SOLR-2033) Response parsing fragility in solrj
[ https://issues.apache.org/jira/browse/SOLR-2033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jan Høydahl closed SOLR-2033.
-----------------------------
Resolution: Implemented
This bug is fixed in current code base
> Response parsing fragility in solrj
> -----------------------------------
>
> Key: SOLR-2033
> URL: https://issues.apache.org/jira/browse/SOLR-2033
> Project: Solr
> Issue Type: Bug
> Components: clients - java
> Affects Versions: 1.4.1
> Reporter: John Wang
>
> In QueryResponse.setResponse(). the ordering of NamedList matters:
> // Look for known things
> for( int i=0; i<res.size(); i++ ) {
> String n = res.getName( i );
> if( "responseHeader".equals( n ) ) {
> _header = (NamedList<Object>) res.getVal( i );
> }
> else if( "response".equals( n ) ) {
> _results = (SolrDocumentList) res.getVal( i );
> }
> else if( "sort_values".equals( n ) ) {
> _sortvalues = (NamedList<ArrayList>) res.getVal( i );
> }
> else if( "facet_counts".equals( n ) ) {
> _facetInfo = (NamedList<Object>) res.getVal( i );
> extractFacetInfo( _facetInfo ); <------------- this will throw NPE if _results is not set, but _result may be set later in the iteration
> }
> else if( "debug".equals( n ) ) {
> _debugInfo = (NamedList<Object>) res.getVal( i );
> extractDebugInfo( _debugInfo );
> }
> else if( "highlighting".equals( n ) ) {
> _highlightingInfo = (NamedList<Object>) res.getVal( i );
> extractHighlightingInfo( _highlightingInfo );
> }
> else if ( "spellcheck".equals( n ) ) {
> _spellInfo = (NamedList<Object>) res.getVal( i );
> extractSpellCheckInfo( _spellInfo );
> }
> else if ( "stats".equals( n ) ) {
> _statsInfo = (NamedList<Object>) res.getVal( i );
> extractStatsInfo( _statsInfo );
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org