fix #1971 add searchlog.agg.shard.size

This commit is contained in:
Shinsuke Sugaya 2019-01-19 09:57:56 +09:00
parent b6d23f4784
commit c8f033eb3c
3 changed files with 40 additions and 0 deletions

View file

@ -119,6 +119,9 @@ public class SearchLogService {
createClickLogCondition(pager, cb);
cb.aggregation().setUrl_Terms(SearchLogPager.LOG_TYPE_CLICK_COUNT, op -> {
op.size(pager.getPageSize());
if (fessConfig.getSearchlogAggShardSizeAsInteger() >= 0) {
op.shardSize(fessConfig.getSearchlogAggShardSizeAsInteger());
}
}, null);
});
final Terms agg = list.getAggregations().get(SearchLogPager.LOG_TYPE_CLICK_COUNT);
@ -143,6 +146,9 @@ public class SearchLogService {
createFavoriteLogCondition(pager, cb);
cb.aggregation().setUrl_Terms(SearchLogPager.LOG_TYPE_FAVORITE_COUNT, op -> {
op.size(pager.getPageSize());
if (fessConfig.getSearchlogAggShardSizeAsInteger() >= 0) {
op.shardSize(fessConfig.getSearchlogAggShardSizeAsInteger());
}
}, null);
});
final Terms agg = list.getAggregations().get(SearchLogPager.LOG_TYPE_FAVORITE_COUNT);
@ -289,6 +295,9 @@ public class SearchLogService {
createSearchLogCondition(pager, cb);
cb.aggregation().setSearchWord_Terms(SearchLogPager.LOG_TYPE_SEARCH_KEYWORD, op -> {
op.size(pager.getPageSize());
if (fessConfig.getSearchlogAggShardSizeAsInteger() >= 0) {
op.shardSize(fessConfig.getSearchlogAggShardSizeAsInteger());
}
}, null);
});
final Terms agg = list.getAggregations().get(SearchLogPager.LOG_TYPE_SEARCH_KEYWORD);
@ -308,6 +317,9 @@ public class SearchLogService {
cb.query().setHitCount_Equal(0L);
cb.aggregation().setSearchWord_Terms(SearchLogPager.LOG_TYPE_SEARCH_ZEROHIT, op -> {
op.size(pager.getPageSize());
if (fessConfig.getSearchlogAggShardSizeAsInteger() >= 0) {
op.shardSize(fessConfig.getSearchlogAggShardSizeAsInteger());
}
}, null);
});
final Terms agg = list.getAggregations().get(SearchLogPager.LOG_TYPE_SEARCH_ZEROHIT);

View file

@ -926,6 +926,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/** The key of the configuration. e.g. 100 */
String PAGING_SEARCH_PAGE_MAX_SIZE = "paging.search.page.max.size";
/** The key of the configuration. e.g. -1 */
String SEARCHLOG_AGG_SHARD_SIZE = "searchlog.agg.shard.size";
/** The key of the configuration. e.g. 100 */
String THUMBNAIL_HTML_IMAGE_MIN_WIDTH = "thumbnail.html.image.min.width";
@ -4423,6 +4426,21 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
*/
Integer getPagingSearchPageMaxSizeAsInteger();
/**
* Get the value for the key 'searchlog.agg.shard.size'. <br>
* The value is, e.g. -1 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getSearchlogAggShardSize();
/**
* Get the value for the key 'searchlog.agg.shard.size' as {@link Integer}. <br>
* The value is, e.g. -1 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
* @throws NumberFormatException When the property is not integer.
*/
Integer getSearchlogAggShardSizeAsInteger();
/**
* Get the value for the key 'thumbnail.html.image.min.width'. <br>
* The value is, e.g. 100 <br>
@ -7462,6 +7480,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
return getAsInteger(FessConfig.PAGING_SEARCH_PAGE_MAX_SIZE);
}
public String getSearchlogAggShardSize() {
return get(FessConfig.SEARCHLOG_AGG_SHARD_SIZE);
}
public Integer getSearchlogAggShardSizeAsInteger() {
return getAsInteger(FessConfig.SEARCHLOG_AGG_SHARD_SIZE);
}
public String getThumbnailHtmlImageMinWidth() {
return get(FessConfig.THUMBNAIL_HTML_IMAGE_MIN_WIDTH);
}
@ -8563,6 +8589,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
defaultMap.put(FessConfig.PAGING_SEARCH_PAGE_START, "0");
defaultMap.put(FessConfig.PAGING_SEARCH_PAGE_SIZE, "10");
defaultMap.put(FessConfig.PAGING_SEARCH_PAGE_MAX_SIZE, "100");
defaultMap.put(FessConfig.SEARCHLOG_AGG_SHARD_SIZE, "-1");
defaultMap.put(FessConfig.THUMBNAIL_HTML_IMAGE_MIN_WIDTH, "100");
defaultMap.put(FessConfig.THUMBNAIL_HTML_IMAGE_MIN_HEIGHT, "100");
defaultMap.put(FessConfig.THUMBNAIL_HTML_IMAGE_MAX_ASPECT_RATIO, "3.0");

View file

@ -492,6 +492,7 @@ paging.search.page.start=0
paging.search.page.size=10
paging.search.page.max.size=100
searchlog.agg.shard.size=-1
thumbnail.html.image.min.width=100
thumbnail.html.image.min.height=100