Authored by hugufei

Merge branch 'master' into dev

... ... @@ -57,7 +57,7 @@ if [ $PRODUCTION_MODE = "PRODUCT" ]; then
if [ -n "$str" ]; then
let memTotal=`cat /proc/meminfo |grep MemTotal|awk '{printf "%d", $2/1024 }'`
if [ $memTotal -gt 10000 ];then
JAVA_MEM_OPTS=" -server -Xmx2500M -Xms2500M -Xmn400M -XX:PermSize=200M -XX:MaxPermSize=200M -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -Xloggc:$WEB_APP_HOME/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$WEB_APP_HOME/logs/heapdump.hprof "
JAVA_MEM_OPTS=" -server -Xmx4000M -Xms4000M -Xmn600M -XX:PermSize=200M -XX:MaxPermSize=200M -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=1 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -Xloggc:$WEB_APP_HOME/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$WEB_APP_HOME/logs/heapdump.hprof "
else
JAVA_MEM_OPTS=" -server -Xmx1g -Xms1g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=64m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
fi
... ...
... ... @@ -446,16 +446,17 @@ public class SearchService {
searchParam.setQuery(searchServiceHelper.constructQueryBuilder(paramMap));
searchParam.setFiter(searchServiceHelper.constructFilterBuilder(paramMap, null));
}
// 构造聚合条件(如果需要小分类,则加上小分类的聚合)
List<AbstractAggregationBuilder> aggregationBuilders = new ArrayList<AbstractAggregationBuilder>();
TermsBuilder builder = AggregationBuilders.terms("maxAgg").field("maxSortName").size(50)
.subAggregation(AggregationBuilders.terms("middleAgg").field("middleSortName").size(100));
TermsBuilder maxAggBuilder = AggregationBuilders.terms("maxAgg").field("maxSortName").size(50);
TermsBuilder middleAggBuilder = AggregationBuilders.terms("middleAgg").field("middleSortName").size(50);
TermsBuilder smallAggBuilder = AggregationBuilders.terms("smallAgg").field("smallSortName").size(50);
if (paramMap.containsKey("needSmallSort") && "1".equals(paramMap.get("needSmallSort"))) {
builder.subAggregation(AggregationBuilders.terms("smallAgg").field("smallSortName").size(100));
maxAggBuilder.subAggregation(middleAggBuilder.subAggregation(smallAggBuilder));
} else {
maxAggBuilder.subAggregation(middleAggBuilder);
}
aggregationBuilders.add(builder);
searchParam.setAggregationBuilders(aggregationBuilders);
searchParam.setAggregationBuilders(Arrays.asList(maxAggBuilder));
// 设置查询结果返回字段
List<String> resultFields = new ArrayList<String>();
... ...