}
@Override
public SenseiSystemInfo mergeResults(SenseiRequest request, List<SenseiSystemInfo> resultList)
{
SenseiSystemInfo result = new SenseiSystemInfo();
if (resultList == null)
return result;
for (SenseiSystemInfo res : resultList)
{
result.setNumDocs(result.getNumDocs()+res.getNumDocs());
result.setSchema(res.getSchema());
if (result.getLastModified() < res.getLastModified())
result.setLastModified(res.getLastModified());
if (result.getVersion() == null || _versionComparator.compare(result.getVersion(), res.getVersion()) < 0)
result.setVersion(res.getVersion());
if (res.getFacetInfos() != null)
result.setFacetInfos(res.getFacetInfos());
if (res.getClusterInfo() != null) {
if (result.getClusterInfo() != null)
result.getClusterInfo().addAll(res.getClusterInfo());
else
result.setClusterInfo(res.getClusterInfo());
}
}
return result;
}