fix #2713 improve query for search log
This commit is contained in:
parent
875d9ba17e
commit
50cf9ec75d
32 changed files with 48 additions and 33 deletions
|
@ -168,7 +168,7 @@ public class BsAccessTokenCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsBadWordCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsBoostDocumentRuleCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsCrawlingInfoCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsCrawlingInfoParamCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsDataConfigCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsDuplicateHostCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsElevateWordCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsElevateWordToLabelCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsFailureUrlCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsFileAuthenticationCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsFileConfigCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsJobLogCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsKeyMatchCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsLabelTypeCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsPathMappingCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsRelatedContentCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsRelatedQueryCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsRequestHeaderCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsRoleTypeCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsScheduledJobCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsThumbnailQueueCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsWebAuthenticationCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsWebConfigCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsClickLogCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsFavoriteLogCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsSearchLogCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsUserInfoCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsGroupCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsRoleCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class BsUserCB extends EsAbstractConditionBean {
|
|||
public static class HpSpecification {
|
||||
protected List<String> columnList = new ArrayList<>();
|
||||
|
||||
private void doColumn(String name) {
|
||||
public void doColumn(String name) {
|
||||
columnList.add(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class SuggestHelper {
|
|||
|
||||
protected PopularWordHelper popularWordHelper = null;
|
||||
|
||||
public long searchStoreIntervalMinute = 1;
|
||||
protected long searchStoreInterval = 1; // min
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
@ -135,6 +135,17 @@ public class SuggestHelper {
|
|||
final String from = LocalDateTime.now().minusDays(fessConfig.getPurgeSuggestSearchLogDay()).format(DateTimeFormatter.ISO_DATE);
|
||||
cb.query().addQuery(QueryBuilders.rangeQuery("requestedAt").gte(from));
|
||||
cb.query().addOrderBy_RequestedAt_Asc();
|
||||
cb.specify().columnAccessType();
|
||||
cb.specify().columnUserSessionId();
|
||||
cb.specify().columnHitCount();
|
||||
cb.specify().columnClientIp();
|
||||
cb.specify().columnSearchWord();
|
||||
cb.specify().columnRequestedAt();
|
||||
cb.specify().columnHitCount();
|
||||
cb.specify().columnVirtualHost();
|
||||
cb.specify().columnLanguages();
|
||||
cb.specify().columnRoles();
|
||||
cb.specify().doColumn("searchField.*");
|
||||
}, this::indexFromSearchLog);
|
||||
}
|
||||
|
||||
|
@ -157,7 +168,7 @@ public class SuggestHelper {
|
|||
|
||||
final LocalDateTime requestedAt = searchLog.getRequestedAt();
|
||||
if ((sessionId == null) || (duplicateSessionMap.containsKey(sessionId)
|
||||
&& duplicateSessionMap.get(sessionId).plusMinutes(searchStoreIntervalMinute).isAfter(requestedAt))) {
|
||||
&& duplicateSessionMap.get(sessionId).plusMinutes(searchStoreInterval).isAfter(requestedAt))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -386,4 +397,8 @@ public class SuggestHelper {
|
|||
popularWordHelper.clearCache();
|
||||
}
|
||||
}
|
||||
|
||||
public void setSearchStoreInterval(long searchStoreInterval) {
|
||||
this.searchStoreInterval = searchStoreInterval;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue