Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

65593: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (4.3/Cloud)
      65443: MNT-10826: When SOLR encounters an error during a search, it returns empty result set rather than an error message
      Error from the SOLR side needs to be captured and sent over in the results. It should be thrown on the repository side.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@66247 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-04-02 21:50:30 +00:00
parent 3ed182f472
commit 48bc4bc879

View File

@@ -463,6 +463,16 @@ public class SolrQueryHTTPClient implements BeanFactoryAware
Reader reader = new BufferedReader(new InputStreamReader(post.getResponseBodyAsStream(), post.getResponseCharSet()));
// TODO - replace with streaming-based solution e.g. SimpleJSON ContentHandler
JSONObject json = new JSONObject(new JSONTokener(reader));
if (json.has("status"))
{
JSONObject status = json.getJSONObject("status");
if (status.getInt("code") != HttpServletResponse.SC_OK)
{
throw new LuceneQueryParserException("SOLR side error: " + status.getString("message"));
}
}
SolrJSONResultSet results = new SolrJSONResultSet(json, searchParameters, nodeService, nodeDAO, limitBy, maxResults);
if (s_logger.isDebugEnabled())
{