mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
63338: Merged BRANCHES/DEV/KEVINR to HEAD-BUG-FIX 63337: Fix bug in SolrJSONResultSet where 'lastIndexedTx' is not always reported in JSON returned from SOLR but it is assumed to be mandatory. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@64283 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -37,6 +37,8 @@ import org.alfresco.service.cmr.search.ResultSetMetaData;
|
||||
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -46,6 +48,8 @@ import org.json.JSONObject;
|
||||
*/
|
||||
public class SolrJSONResultSet implements ResultSet
|
||||
{
|
||||
private static final Log logger = LogFactory.getLog(SolrJSONResultSet.class);
|
||||
|
||||
private NodeService nodeService;
|
||||
|
||||
private ArrayList<Pair<Long, Float>> page;
|
||||
@@ -91,12 +95,14 @@ public class SolrJSONResultSet implements ResultSet
|
||||
numberFound = response.getLong("numFound");
|
||||
start = response.getLong("start");
|
||||
maxScore = Float.valueOf(response.getString("maxScore"));
|
||||
lastIndexedTxId = json.getLong("lastIndexedTx");
|
||||
if (json.has("lastIndexedTx"))
|
||||
{
|
||||
lastIndexedTxId = json.getLong("lastIndexedTx");
|
||||
}
|
||||
|
||||
JSONArray docs = response.getJSONArray("docs");
|
||||
|
||||
int numDocs = docs.length();
|
||||
|
||||
|
||||
ArrayList<Long> rawDbids = new ArrayList<Long>(numDocs);
|
||||
ArrayList<Float> rawScores = new ArrayList<Float>(numDocs);
|
||||
@@ -161,7 +167,7 @@ public class SolrJSONResultSet implements ResultSet
|
||||
}
|
||||
catch (JSONException e)
|
||||
{
|
||||
|
||||
logger.info(e.getMessage());
|
||||
}
|
||||
// We'll say we were unlimited if we got a number less than the limit
|
||||
this.resultSetMetaData = new SimpleResultSetMetaData(
|
||||
|
Reference in New Issue
Block a user