mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged 5.2.N (5.2.1) to HEAD (5.2)
128737 ahind: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1) 128736 ahind: Merged 5.1.0 (5.1.0.9) to 5.1.N (5.1.2) 128469 ahind: MNT-16445: Inconsistent behavior of Site File Type Breakdown dashlet in a sharded environment git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129277 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -275,7 +275,7 @@ public class SolrQueryHTTPClient implements BeanFactoryAware, InitializingBean
|
||||
|
||||
Pair<HttpClient, String> httpClientAndBaseUrl = mapping.getHttpClientAndBaseUrl();
|
||||
HttpClient httpClient = httpClientAndBaseUrl.getFirst();
|
||||
String url = buildStatsUrl(searchParameters, httpClientAndBaseUrl.getSecond(), locale);
|
||||
String url = buildStatsUrl(searchParameters, httpClientAndBaseUrl.getSecond(), locale, mapping);
|
||||
JSONObject body = buildStatsBody(searchParameters, tenantService.getCurrentUserDomain(), locale);
|
||||
|
||||
if(httpClient == null)
|
||||
@@ -312,7 +312,7 @@ public class SolrQueryHTTPClient implements BeanFactoryAware, InitializingBean
|
||||
}
|
||||
}
|
||||
|
||||
protected String buildStatsUrl(StatsParameters searchParameters, String baseUrl, Locale locale) throws UnsupportedEncodingException
|
||||
protected String buildStatsUrl(StatsParameters searchParameters, String baseUrl, Locale locale, SolrStoreMappingWrapper mapping) throws UnsupportedEncodingException
|
||||
{
|
||||
URLCodec encoder = new URLCodec();
|
||||
StringBuilder url = new StringBuilder();
|
||||
@@ -337,6 +337,28 @@ public class SolrQueryHTTPClient implements BeanFactoryAware, InitializingBean
|
||||
url.append("&stats.").append(entry.getKey()).append("=").append(encoder.encode(entry.getValue(), "UTF-8"));
|
||||
}
|
||||
|
||||
if((mapping != null) && ((searchParameters.getStores().size() > 1) || (mapping.isSharded())))
|
||||
{
|
||||
boolean requiresSeparator = false;
|
||||
url.append("&shards=");
|
||||
for(StoreRef storeRef : searchParameters.getStores())
|
||||
{
|
||||
SolrStoreMappingWrapper storeMapping = extractMapping(storeRef);
|
||||
|
||||
if(requiresSeparator)
|
||||
{
|
||||
url.append(',');
|
||||
}
|
||||
else
|
||||
{
|
||||
requiresSeparator = true;
|
||||
}
|
||||
|
||||
url.append(storeMapping.getShards());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user