You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "John Wang (JIRA)" <ji...@apache.org> on 2010/08/08 05:19:16 UTC
[jira] Created: (SOLR-2033) Response parsing fragility in solrj
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 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