fix #2485 add page.searchlist.track.total.hits

This commit is contained in:
Shinsuke Sugaya 2020-09-24 22:09:22 +09:00
parent d29148d6b8
commit 8f8003d3b8
5 changed files with 43 additions and 6 deletions

View file

@ -159,4 +159,13 @@ public class ListForm extends SearchRequestParams {
public String getSimilarDocHash() {
return sdh;
}
@Override
public String getTrackTotalHits() {
final String value = ComponentUtil.getFessConfig().getPageSearchlistTrackTotalHits();
if (StringUtil.isNotBlank(value)) {
return value;
}
return null;
}
}

View file

@ -1158,16 +1158,16 @@ public class FessEsClient implements Client {
protected void buildTrackTotalHits(final FessConfig fessConfig) {
if (StringUtil.isNotBlank(trackTotalHits)) {
if (Constants.TRUE.equalsIgnoreCase(trackTotalHits) || Constants.FALSE.equalsIgnoreCase(trackTotalHits)) {
searchRequestBuilder.setTrackTotalHits(Boolean.valueOf(trackTotalHits));
return;
}
try {
searchRequestBuilder.setTrackTotalHitsUpTo(Integer.valueOf(trackTotalHits));
return;
} catch (final NumberFormatException e) {
// ignore
}
if (Constants.TRUE.equalsIgnoreCase(trackTotalHits) || Constants.FALSE.equalsIgnoreCase(trackTotalHits)) {
searchRequestBuilder.setTrackTotalHits(Boolean.valueOf(trackTotalHits));
return;
}
}
final Object trackTotalHitsValue = fessConfig.getQueryTrackTotalHitsValue();
if (trackTotalHitsValue instanceof Boolean) {

View file

@ -1118,6 +1118,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/** The key of the configuration. e.g. 10000 */
String PAGE_SEARCHLOG_MAX_FETCH_SIZE = "page.searchlog.max.fetch.size";
/** The key of the configuration. e.g. true */
String PAGE_SEARCHLIST_TRACK_TOTAL_HITS = "page.searchlist.track.total.hits";
/** The key of the configuration. e.g. 0 */
String PAGING_SEARCH_PAGE_START = "paging.search.page.start";
@ -5075,6 +5078,20 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
*/
Integer getPageSearchlogMaxFetchSizeAsInteger();
/**
* Get the value for the key 'page.searchlist.track.total.hits'. <br>
* The value is, e.g. true <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getPageSearchlistTrackTotalHits();
/**
* Is the property for the key 'page.searchlist.track.total.hits' true? <br>
* The value is, e.g. true <br>
* @return The determination, true or false. (if not found, exception but basically no way)
*/
boolean isPageSearchlistTrackTotalHits();
/**
* Get the value for the key 'paging.search.page.start'. <br>
* The value is, e.g. 0 <br>
@ -8304,6 +8321,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
return getAsInteger(FessConfig.PAGE_SEARCHLOG_MAX_FETCH_SIZE);
}
public String getPageSearchlistTrackTotalHits() {
return get(FessConfig.PAGE_SEARCHLIST_TRACK_TOTAL_HITS);
}
public boolean isPageSearchlistTrackTotalHits() {
return is(FessConfig.PAGE_SEARCHLIST_TRACK_TOTAL_HITS);
}
public String getPagingSearchPageStart() {
return get(FessConfig.PAGING_SEARCH_PAGE_START);
}
@ -9426,6 +9451,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
defaultMap.put(FessConfig.PAGE_THUMBNAIL_PURGE_MAX_FETCH_SIZE, "100");
defaultMap.put(FessConfig.PAGE_SCORE_BOOSTER_MAX_FETCH_SIZE, "1000");
defaultMap.put(FessConfig.PAGE_SEARCHLOG_MAX_FETCH_SIZE, "10000");
defaultMap.put(FessConfig.PAGE_SEARCHLIST_TRACK_TOTAL_HITS, "true");
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");

View file

@ -629,6 +629,8 @@ page.thumbnail.purge.max.fetch.size=100
page.score.booster.max.fetch.size=1000
page.searchlog.max.fetch.size=10000
page.searchlist.track.total.hits=true
# search page
paging.search.page.start=0
paging.search.page.size=10

View file

@ -81,12 +81,12 @@
<c:when test="${f:h(allRecordCount) > 0}">
<div id="subheader" class="row top10">
<div class="col-12">
<c:if test="${allRecordCountRelation==null}">
<c:if test="${allRecordCountRelation=='EQUAL_TO'}">
<la:message key="labels.search_result_status"
arg0="${f:h(q)}" arg1="${f:h(allRecordCount)}"
arg2="${f:h(currentStartRecordNumber)}"
arg3="${f:h(currentEndRecordNumber)}"/>
</c:if><c:if test="${allRecordCountRelation!=null}">
</c:if><c:if test="${allRecordCountRelation!='EQUAL_TO'}">
<la:message key="labels.search_result_status_over"
arg0="${f:h(q)}" arg1="${f:h(allRecordCount)}"
arg2="${f:h(currentStartRecordNumber)}"