Search in sources :

Example 1 with SearchFieldLogBhv

use of org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv in project fess by codelibs.

the class SearchLog method getSearchFieldLogList.

public List<SearchFieldLog> getSearchFieldLogList() {
    if (searchFieldLogList == null) {
        final SearchFieldLogBhv searchFieldLogBhv = ComponentUtil.getComponent(SearchFieldLogBhv.class);
        searchFieldLogList = searchFieldLogBhv.selectList(cb -> {
            cb.query().setSearchLogId_Equal(getId());
            cb.fetchFirst(ComponentUtil.getFessConfig().getPageSearchFieldLogMaxFetchSizeAsInteger());
        });
    }
    return searchFieldLogList;
}
Also used : Arrays(java.util.Arrays) Constants(org.codelibs.fess.Constants) UserInfoBhv(org.codelibs.fess.es.log.exbhv.UserInfoBhv) OptionalEntity(org.dbflute.optional.OptionalEntity) ZonedDateTime(java.time.ZonedDateTime) SearchFieldLogBhv(org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv) LocalDateTime(java.time.LocalDateTime) StringUtil(org.codelibs.core.lang.StringUtil) ZoneId(java.time.ZoneId) ArrayList(java.util.ArrayList) List(java.util.List) ComponentUtil(org.codelibs.fess.util.ComponentUtil) DateTimeFormatter(java.time.format.DateTimeFormatter) Map(java.util.Map) BsSearchLog(org.codelibs.fess.es.log.bsentity.BsSearchLog) SearchFieldLogBhv(org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv)

Example 2 with SearchFieldLogBhv

use of org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv in project fess by codelibs.

the class SearchLogHelper method storeSearchLogList.

private void storeSearchLogList(final List<SearchLog> searchLogList) {
    final SearchLogBhv searchLogBhv = ComponentUtil.getComponent(SearchLogBhv.class);
    final SearchFieldLogBhv searchFieldLogBhv = ComponentUtil.getComponent(SearchFieldLogBhv.class);
    searchLogBhv.batchUpdate(searchLogList, op -> {
        op.setRefreshPolicy(Constants.TRUE);
    });
    searchLogList.stream().forEach(searchLog -> {
        final List<SearchFieldLog> fieldLogList = new ArrayList<>();
        searchLog.getSearchFieldLogList().stream().forEach(fieldLog -> {
            fieldLog.setSearchLogId(searchLog.getId());
            fieldLogList.add(fieldLog);
        });
        searchFieldLogBhv.batchInsert(fieldLogList);
    });
}
Also used : SearchFieldLogBhv(org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv) ArrayList(java.util.ArrayList) SearchLogBhv(org.codelibs.fess.es.log.exbhv.SearchLogBhv) SearchFieldLog(org.codelibs.fess.es.log.exentity.SearchFieldLog)

Aggregations

ArrayList (java.util.ArrayList)2 SearchFieldLogBhv (org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv)2 LocalDateTime (java.time.LocalDateTime)1 ZoneId (java.time.ZoneId)1 ZonedDateTime (java.time.ZonedDateTime)1 DateTimeFormatter (java.time.format.DateTimeFormatter)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Map (java.util.Map)1 StringUtil (org.codelibs.core.lang.StringUtil)1 Constants (org.codelibs.fess.Constants)1 BsSearchLog (org.codelibs.fess.es.log.bsentity.BsSearchLog)1 SearchLogBhv (org.codelibs.fess.es.log.exbhv.SearchLogBhv)1 UserInfoBhv (org.codelibs.fess.es.log.exbhv.UserInfoBhv)1 SearchFieldLog (org.codelibs.fess.es.log.exentity.SearchFieldLog)1 ComponentUtil (org.codelibs.fess.util.ComponentUtil)1 OptionalEntity (org.dbflute.optional.OptionalEntity)1