fix #1158 remove search_field_log

fix #1153 add virtualHost to fess_log
This commit is contained in:
Shinsuke Sugaya 2017-07-13 14:17:34 +09:00
parent a6ed94d64d
commit 38f0c0bb52
31 changed files with 446 additions and 2768 deletions

View file

@ -1,26 +1,6 @@
{
"fess_log" : {
"mappings" : {
"search_field_log" : {
"_all" : {
"enabled" : false
},
"properties" : {
"name" : {
"type": "keyword"
},
"searchLogId" : {
"type": "keyword"
},
"value" : {
"type": "keyword"
},
"requestedAt" : {
"type" : "date",
"format" : "date_optional_time"
}
}
},
"favorite_log" : {
"_all" : {
"enabled" : false
@ -130,6 +110,9 @@
},
"languages" : {
"type": "keyword"
},
"virtualHost" : {
"type": "keyword"
}
}
},

View file

@ -17,7 +17,6 @@ package org.codelibs.fess.app.service;
import javax.annotation.Resource;
import org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv;
import org.codelibs.fess.es.log.exbhv.SearchLogBhv;
import org.codelibs.fess.helper.SystemHelper;
@ -26,20 +25,10 @@ public class SearchLogService {
@Resource
private SearchLogBhv searchLogBhv;
@Resource
private SearchFieldLogBhv searchFieldLogBhv;
@Resource
private SystemHelper systemHelper;
public void deleteBefore(final int days) {
searchLogBhv.selectCursor(cb -> {
cb.query().setRequestedAt_LessEqual(systemHelper.getCurrentTimeAsLocalDateTime().minusDays(days));
}, entity -> {
searchFieldLogBhv.queryDelete(subCb -> {
subCb.query().setSearchLogId_Equal(entity.getId());
});
});
searchLogBhv.queryDelete(cb -> {
cb.query().setRequestedAt_LessEqual(systemHelper.getCurrentTimeAsLocalDateTime().minusDays(days));
});

View file

@ -43,7 +43,6 @@ import org.codelibs.elasticsearch.runner.net.CurlResponse;
import org.codelibs.fess.app.web.base.FessAdminAction;
import org.codelibs.fess.es.log.exbhv.ClickLogBhv;
import org.codelibs.fess.es.log.exbhv.FavoriteLogBhv;
import org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv;
import org.codelibs.fess.es.log.exbhv.SearchLogBhv;
import org.codelibs.fess.es.log.exbhv.UserInfoBhv;
import org.codelibs.fess.mylasta.direction.FessConfig;
@ -141,8 +140,6 @@ public class AdminBackupAction extends FessAdminAction {
final String name = id.substring(0, id.length() - CSV_EXTENTION.length());
if ("search_log".equals(name)) {
return writeCsvResponse(id, getSearchLogCsvWriteCall());
} else if ("search_field_log".equals(name)) {
return writeCsvResponse(id, getSearchFieldLogCsvWriteCall());
} else if ("user_info".equals(name)) {
return writeCsvResponse(id, getUserInfoCsvWriteCall());
} else if ("click_log".equals(name)) {
@ -295,26 +292,6 @@ public class AdminBackupAction extends FessAdminAction {
};
}
public static Consumer<CsvWriter> getSearchFieldLogCsvWriteCall() {
return writer -> {
final SearchFieldLogBhv bhv = ComponentUtil.getComponent(SearchFieldLogBhv.class);
bhv.selectCursor(cb -> {
cb.query().matchAll();
cb.query().addOrderBy_SearchLogId_Asc();
}, entity -> {
final List<String> list = new ArrayList<>();
addToList(entity.getSearchLogId(), list);
addToList(entity.getName(), list);
addToList(entity.getValue(), list);
try {
writer.writeValues(list);
} catch (final IOException e) {
throw new RuntimeIOException(e);
}
});
};
}
private static void addToList(final Object value, final List<String> list) {
if (value == null) {
list.add(StringUtil.EMPTY);

View file

@ -20,7 +20,6 @@ import static org.codelibs.fess.app.web.admin.backup.AdminBackupAction.CSV_EXTEN
import static org.codelibs.fess.app.web.admin.backup.AdminBackupAction.getBackupItems;
import static org.codelibs.fess.app.web.admin.backup.AdminBackupAction.getClickLogCsvWriteCall;
import static org.codelibs.fess.app.web.admin.backup.AdminBackupAction.getFavoriteLogCsvWriteCall;
import static org.codelibs.fess.app.web.admin.backup.AdminBackupAction.getSearchFieldLogCsvWriteCall;
import static org.codelibs.fess.app.web.admin.backup.AdminBackupAction.getSearchLogCsvWriteCall;
import static org.codelibs.fess.app.web.admin.backup.AdminBackupAction.getUserInfoCsvWriteCall;
@ -78,8 +77,6 @@ public class ApiAdminBackupAction extends FessApiAdminAction {
final String name = id.substring(0, id.length() - CSV_EXTENTION.length());
if ("search_log".equals(name)) {
return writeCsvResponse(id, getSearchLogCsvWriteCall());
} else if ("search_field_log".equals(name)) {
return writeCsvResponse(id, getSearchFieldLogCsvWriteCall());
} else if ("user_info".equals(name)) {
return writeCsvResponse(id, getUserInfoCsvWriteCall());
} else if ("click_log".equals(name)) {

View file

@ -1,260 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.bsbhv;
import java.util.List;
import java.util.Map;
import org.codelibs.fess.es.log.allcommon.EsAbstractBehavior;
import org.codelibs.fess.es.log.allcommon.EsAbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.log.bsentity.dbmeta.SearchFieldLogDbm;
import org.codelibs.fess.es.log.cbean.SearchFieldLogCB;
import org.codelibs.fess.es.log.exentity.SearchFieldLog;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.bhv.readable.EntityRowHandler;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.dbflute.util.DfTypeUtil;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author ESFlute (using FreeGen)
*/
public abstract class BsSearchFieldLogBhv extends EsAbstractBehavior<SearchFieldLog, SearchFieldLogCB> {
// ===================================================================================
// Control Override
// ================
@Override
public String asTableDbName() {
return asEsIndexType();
}
@Override
protected String asEsIndex() {
return "fess_log";
}
@Override
public String asEsIndexType() {
return "search_field_log";
}
@Override
public String asEsSearchType() {
return "search_field_log";
}
@Override
public SearchFieldLogDbm asDBMeta() {
return SearchFieldLogDbm.getInstance();
}
@Override
protected <RESULT extends SearchFieldLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setName(DfTypeUtil.toString(source.get("name")));
result.setSearchLogId(DfTypeUtil.toString(source.get("searchLogId")));
result.setValue(DfTypeUtil.toString(source.get("value")));
result.setRequestedAt(toLocalDateTime(source.get("requestedAt")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
protected <RESULT extends SearchFieldLog> RESULT updateEntity(Map<String, Object> source, RESULT result) {
return result;
}
// ===================================================================================
// Select
// ======
public int selectCount(CBCall<SearchFieldLogCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<SearchFieldLog> selectEntity(CBCall<SearchFieldLogCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<SearchFieldLog> facadeSelectEntity(SearchFieldLogCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends SearchFieldLog> OptionalEntity<ENTITY> doSelectOptionalEntity(SearchFieldLogCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public SearchFieldLogCB newConditionBean() {
return new SearchFieldLogCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public SearchFieldLog selectEntityWithDeletedCheck(CBCall<SearchFieldLogCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<SearchFieldLog> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<SearchFieldLog> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends SearchFieldLog> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected SearchFieldLogCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends SearchFieldLog> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends SearchFieldLog> typeOfSelectedEntity() {
return SearchFieldLog.class;
}
@Override
protected Class<SearchFieldLog> typeOfHandlingEntity() {
return SearchFieldLog.class;
}
@Override
protected Class<SearchFieldLogCB> typeOfHandlingConditionBean() {
return SearchFieldLogCB.class;
}
public ListResultBean<SearchFieldLog> selectList(CBCall<SearchFieldLogCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<SearchFieldLog> selectPage(CBCall<SearchFieldLogCB> cbLambda) {
// #pending same?
return (PagingResultBean<SearchFieldLog>) facadeSelectList(createCB(cbLambda));
}
public void selectCursor(CBCall<SearchFieldLogCB> cbLambda, EntityRowHandler<SearchFieldLog> entityLambda) {
facadeSelectCursor(createCB(cbLambda), entityLambda);
}
public void selectBulk(CBCall<SearchFieldLogCB> cbLambda, EntityRowHandler<List<SearchFieldLog>> entityLambda) {
delegateSelectBulk(createCB(cbLambda), entityLambda, typeOfSelectedEntity());
}
// ===================================================================================
// Update
// ======
public void insert(SearchFieldLog entity) {
doInsert(entity, null);
}
public void insert(SearchFieldLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
entity.asDocMeta().indexOption(opLambda);
doInsert(entity, null);
}
public void update(SearchFieldLog entity) {
doUpdate(entity, null);
}
public void update(SearchFieldLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
entity.asDocMeta().indexOption(opLambda);
doUpdate(entity, null);
}
public void insertOrUpdate(SearchFieldLog entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(SearchFieldLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
entity.asDocMeta().indexOption(opLambda);
doInsertOrUpdate(entity, null, null);
}
public void delete(SearchFieldLog entity) {
doDelete(entity, null);
}
public void delete(SearchFieldLog entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
entity.asDocMeta().deleteOption(opLambda);
doDelete(entity, null);
}
public int queryDelete(CBCall<SearchFieldLogCB> cbLambda) {
return doQueryDelete(createCB(cbLambda), null);
}
public int[] batchInsert(List<SearchFieldLog> list) {
return batchInsert(list, null, null);
}
public int[] batchInsert(List<SearchFieldLog> list, RequestOptionCall<BulkRequestBuilder> call) {
return batchInsert(list, call, null);
}
public int[] batchInsert(List<SearchFieldLog> list, RequestOptionCall<BulkRequestBuilder> call,
RequestOptionCall<IndexRequestBuilder> entityCall) {
return doBatchInsert(new BulkList<>(list, call, entityCall), null);
}
public int[] batchUpdate(List<SearchFieldLog> list) {
return batchUpdate(list, null, null);
}
public int[] batchUpdate(List<SearchFieldLog> list, RequestOptionCall<BulkRequestBuilder> call) {
return batchUpdate(list, call, null);
}
public int[] batchUpdate(List<SearchFieldLog> list, RequestOptionCall<BulkRequestBuilder> call,
RequestOptionCall<IndexRequestBuilder> entityCall) {
return doBatchUpdate(new BulkList<>(list, call, entityCall), null);
}
public int[] batchDelete(List<SearchFieldLog> list) {
return batchDelete(list, null, null);
}
public int[] batchDelete(List<SearchFieldLog> list, RequestOptionCall<BulkRequestBuilder> call) {
return batchDelete(list, call, null);
}
public int[] batchDelete(List<SearchFieldLog> list, RequestOptionCall<BulkRequestBuilder> call,
RequestOptionCall<IndexRequestBuilder> entityCall) {
return doBatchDelete(new BulkList<>(list, call, entityCall), null);
}
// #pending create, modify, remove
}

View file

@ -90,6 +90,7 @@ public abstract class BsSearchLogBhv extends EsAbstractBehavior<SearchLog, Searc
result.setUserInfoId(DfTypeUtil.toString(source.get("userInfoId")));
result.setUserSessionId(DfTypeUtil.toString(source.get("userSessionId")));
result.setLanguages(DfTypeUtil.toString(source.get("languages")));
result.setVirtualHost(DfTypeUtil.toString(source.get("virtualHost")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();

View file

@ -1,151 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.bsentity;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.log.allcommon.EsAbstractEntity;
import org.codelibs.fess.es.log.bsentity.dbmeta.SearchFieldLogDbm;
/**
* ${table.comment}
* @author ESFlute (using FreeGen)
*/
public class BsSearchFieldLog extends EsAbstractEntity {
// ===================================================================================
// Definition
// ==========
private static final long serialVersionUID = 1L;
protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
// ===================================================================================
// Attribute
// =========
/** name */
protected String name;
/** searchLogId */
protected String searchLogId;
/** value */
protected String value;
/** requestedAt */
protected LocalDateTime requestedAt;
// [Referrers] *comment only
// ===================================================================================
// DB Meta
// =======
@Override
public SearchFieldLogDbm asDBMeta() {
return SearchFieldLogDbm.getInstance();
}
@Override
public String asTableDbName() {
return "search_field_log";
}
// ===================================================================================
// Source
// ======
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (name != null) {
addFieldToSource(sourceMap, "name", name);
}
if (searchLogId != null) {
addFieldToSource(sourceMap, "searchLogId", searchLogId);
}
if (value != null) {
addFieldToSource(sourceMap, "value", value);
}
if (requestedAt != null) {
addFieldToSource(sourceMap, "requestedAt", requestedAt);
}
return sourceMap;
}
protected void addFieldToSource(Map<String, Object> sourceMap, String field, Object value) {
sourceMap.put(field, value);
}
// ===================================================================================
// Basic Override
// ==============
@Override
protected String doBuildColumnString(String dm) {
StringBuilder sb = new StringBuilder();
sb.append(dm).append(name);
sb.append(dm).append(searchLogId);
sb.append(dm).append(value);
sb.append(dm).append(requestedAt);
if (sb.length() > dm.length()) {
sb.delete(0, dm.length());
}
sb.insert(0, "{").append("}");
return sb.toString();
}
// ===================================================================================
// Accessor
// ========
public String getName() {
checkSpecifiedProperty("name");
return convertEmptyToNull(name);
}
public void setName(String value) {
registerModifiedProperty("name");
this.name = value;
}
public String getSearchLogId() {
checkSpecifiedProperty("searchLogId");
return convertEmptyToNull(searchLogId);
}
public void setSearchLogId(String value) {
registerModifiedProperty("searchLogId");
this.searchLogId = value;
}
public String getValue() {
checkSpecifiedProperty("value");
return convertEmptyToNull(value);
}
public void setValue(String value) {
registerModifiedProperty("value");
this.value = value;
}
public LocalDateTime getRequestedAt() {
checkSpecifiedProperty("requestedAt");
return requestedAt;
}
public void setRequestedAt(LocalDateTime value) {
registerModifiedProperty("requestedAt");
this.requestedAt = value;
}
}

View file

@ -88,6 +88,9 @@ public class BsSearchLog extends EsAbstractEntity {
/** languages */
protected String languages;
/** virtualHost */
protected String virtualHost;
// [Referrers] *comment only
// ===================================================================================
@ -160,6 +163,9 @@ public class BsSearchLog extends EsAbstractEntity {
if (languages != null) {
addFieldToSource(sourceMap, "languages", languages);
}
if (virtualHost != null) {
addFieldToSource(sourceMap, "virtualHost", virtualHost);
}
return sourceMap;
}
@ -190,6 +196,7 @@ public class BsSearchLog extends EsAbstractEntity {
sb.append(dm).append(userInfoId);
sb.append(dm).append(userSessionId);
sb.append(dm).append(languages);
sb.append(dm).append(virtualHost);
if (sb.length() > dm.length()) {
sb.delete(0, dm.length());
}
@ -369,4 +376,14 @@ public class BsSearchLog extends EsAbstractEntity {
registerModifiedProperty("languages");
this.languages = value;
}
public String getVirtualHost() {
checkSpecifiedProperty("virtualHost");
return convertEmptyToNull(virtualHost);
}
public void setVirtualHost(String value) {
registerModifiedProperty("virtualHost");
this.virtualHost = value;
}
}

View file

@ -1,231 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.bsentity.dbmeta;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import org.codelibs.fess.es.log.exentity.SearchFieldLog;
import org.dbflute.Entity;
import org.dbflute.dbmeta.AbstractDBMeta;
import org.dbflute.dbmeta.info.ColumnInfo;
import org.dbflute.dbmeta.info.UniqueInfo;
import org.dbflute.dbmeta.name.TableSqlName;
import org.dbflute.dbmeta.property.PropertyGateway;
import org.dbflute.dbway.DBDef;
import org.dbflute.util.DfTypeUtil;
/**
* @author ESFlute (using FreeGen)
*/
public class SearchFieldLogDbm extends AbstractDBMeta {
protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
// ===================================================================================
// Singleton
// =========
private static final SearchFieldLogDbm _instance = new SearchFieldLogDbm();
private SearchFieldLogDbm() {
}
public static SearchFieldLogDbm getInstance() {
return _instance;
}
// ===================================================================================
// Current DBDef
// =============
@Override
public String getProjectName() {
return null;
}
@Override
public String getProjectPrefix() {
return null;
}
@Override
public String getGenerationGapBasePrefix() {
return null;
}
@Override
public DBDef getCurrentDBDef() {
return null;
}
// ===================================================================================
// Property Gateway
// ================
// -----------------------------------------------------
// Column Property
// ---------------
protected final Map<String, PropertyGateway> _epgMap = newHashMap();
{
setupEpg(_epgMap, et -> ((SearchFieldLog) et).getName(), (et, vl) -> ((SearchFieldLog) et).setName(DfTypeUtil.toString(vl)), "name");
setupEpg(_epgMap, et -> ((SearchFieldLog) et).getSearchLogId(),
(et, vl) -> ((SearchFieldLog) et).setSearchLogId(DfTypeUtil.toString(vl)), "searchLogId");
setupEpg(_epgMap, et -> ((SearchFieldLog) et).getValue(), (et, vl) -> ((SearchFieldLog) et).setValue(DfTypeUtil.toString(vl)),
"value");
setupEpg(_epgMap, et -> ((SearchFieldLog) et).getRequestedAt(),
(et, vl) -> ((SearchFieldLog) et).setRequestedAt(DfTypeUtil.toLocalDateTime(vl)), "requestedAt");
}
@Override
public PropertyGateway findPropertyGateway(final String prop) {
return doFindEpg(_epgMap, prop);
}
// ===================================================================================
// Table Info
// ==========
protected final String _tableDbName = "search_field_log";
protected final String _tableDispName = "search_field_log";
protected final String _tablePropertyName = "SearchFieldLog";
public String getTableDbName() {
return _tableDbName;
}
@Override
public String getTableDispName() {
return _tableDispName;
}
@Override
public String getTablePropertyName() {
return _tablePropertyName;
}
@Override
public TableSqlName getTableSqlName() {
return null;
}
// ===================================================================================
// Column Info
// ===========
protected final ColumnInfo _columnName = cci("name", "name", null, null, String.class, "name", null, false, false, false, "keyword", 0,
0, null, false, null, null, null, null, null, false);
protected final ColumnInfo _columnSearchLogId = cci("searchLogId", "searchLogId", null, null, String.class, "searchLogId", null, false,
false, false, "keyword", 0, 0, null, false, null, null, null, null, null, false);
protected final ColumnInfo _columnValue = cci("value", "value", null, null, String.class, "value", null, false, false, false,
"keyword", 0, 0, null, false, null, null, null, null, null, false);
protected final ColumnInfo _columnRequestedAt = cci("requestedAt", "requestedAt", null, null, LocalDateTime.class, "requestedAt", null,
false, false, false, "LocalDateTime", 0, 0, null, false, null, null, null, null, null, false);
public ColumnInfo columnName() {
return _columnName;
}
public ColumnInfo columnSearchLogId() {
return _columnSearchLogId;
}
public ColumnInfo columnValue() {
return _columnValue;
}
public ColumnInfo columnRequestedAt() {
return _columnRequestedAt;
}
protected List<ColumnInfo> ccil() {
List<ColumnInfo> ls = newArrayList();
ls.add(columnName());
ls.add(columnSearchLogId());
ls.add(columnValue());
ls.add(columnRequestedAt());
return ls;
}
// ===================================================================================
// Unique Info
// ===========
@Override
public boolean hasPrimaryKey() {
return false;
}
@Override
public boolean hasCompoundPrimaryKey() {
return false;
}
@Override
protected UniqueInfo cpui() {
return null;
}
// ===================================================================================
// Type Name
// =========
@Override
public String getEntityTypeName() {
return "org.codelibs.fess.es.log.exentity.SearchFieldLog";
}
@Override
public String getConditionBeanTypeName() {
return "org.codelibs.fess.es.log.cbean.SearchFieldLogCB";
}
@Override
public String getBehaviorTypeName() {
return "org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv";
}
// ===================================================================================
// Object Type
// ===========
@Override
public Class<? extends Entity> getEntityType() {
return SearchFieldLog.class;
}
// ===================================================================================
// Object Instance
// ===============
@Override
public Entity newEntity() {
return new SearchFieldLog();
}
// ===================================================================================
// Map Communication
// =================
@Override
public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
}
@Override
public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
}
@Override
public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
return null;
}
@Override
public Map<String, Object> extractAllColumnMap(Entity entity) {
return null;
}
}

View file

@ -108,6 +108,8 @@ public class SearchLogDbm extends AbstractDBMeta {
(et, vl) -> ((SearchLog) et).setUserSessionId(DfTypeUtil.toString(vl)), "userSessionId");
setupEpg(_epgMap, et -> ((SearchLog) et).getLanguages(), (et, vl) -> ((SearchLog) et).setLanguages(DfTypeUtil.toString(vl)),
"languages");
setupEpg(_epgMap, et -> ((SearchLog) et).getVirtualHost(), (et, vl) -> ((SearchLog) et).setVirtualHost(DfTypeUtil.toString(vl)),
"virtualHost");
}
@Override
@ -178,6 +180,8 @@ public class SearchLogDbm extends AbstractDBMeta {
null, false, false, false, "keyword", 0, 0, null, false, null, null, null, null, null, false);
protected final ColumnInfo _columnLanguages = cci("languages", "languages", null, null, String.class, "languages", null, false, false,
false, "keyword", 0, 0, null, false, null, null, null, null, null, false);
protected final ColumnInfo _columnVirtualHost = cci("virtualHost", "virtualHost", null, null, String.class, "virtualHost", null, false,
false, false, "keyword", 0, 0, null, false, null, null, null, null, null, false);
public ColumnInfo columnAccessType() {
return _columnAccessType;
@ -247,6 +251,10 @@ public class SearchLogDbm extends AbstractDBMeta {
return _columnLanguages;
}
public ColumnInfo columnVirtualHost() {
return _columnVirtualHost;
}
protected List<ColumnInfo> ccil() {
List<ColumnInfo> ls = newArrayList();
ls.add(columnAccessType());
@ -266,6 +274,7 @@ public class SearchLogDbm extends AbstractDBMeta {
ls.add(columnUserInfoId());
ls.add(columnUserSessionId());
ls.add(columnLanguages());
ls.add(columnVirtualHost());
return ls;
}

View file

@ -1,24 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.cbean;
import org.codelibs.fess.es.log.cbean.bs.BsSearchFieldLogCB;
/**
* @author ESFlute (using FreeGen)
*/
public class SearchFieldLogCB extends BsSearchFieldLogCB {
}

View file

@ -1,195 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.cbean.bs;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.codelibs.fess.es.log.allcommon.EsAbstractConditionBean;
import org.codelibs.fess.es.log.bsentity.dbmeta.SearchFieldLogDbm;
import org.codelibs.fess.es.log.cbean.SearchFieldLogCB;
import org.codelibs.fess.es.log.cbean.ca.SearchFieldLogCA;
import org.codelibs.fess.es.log.cbean.ca.bs.BsSearchFieldLogCA;
import org.codelibs.fess.es.log.cbean.cq.SearchFieldLogCQ;
import org.codelibs.fess.es.log.cbean.cq.bs.BsSearchFieldLogCQ;
import org.dbflute.cbean.ConditionQuery;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.index.query.QueryBuilder;
/**
* @author ESFlute (using FreeGen)
*/
public class BsSearchFieldLogCB extends EsAbstractConditionBean {
// ===================================================================================
// Attribute
// =========
protected BsSearchFieldLogCQ _conditionQuery;
protected BsSearchFieldLogCA _conditionAggregation;
protected HpSpecification _specification;
// ===================================================================================
// Control
// =======
@Override
public SearchFieldLogDbm asDBMeta() {
return SearchFieldLogDbm.getInstance();
}
@Override
public String asTableDbName() {
return "search_field_log";
}
@Override
public boolean hasSpecifiedColumn() {
return _specification != null;
}
@Override
public ConditionQuery localCQ() {
return doGetConditionQuery();
}
// ===================================================================================
// Primary Key
// ===========
public SearchFieldLogCB acceptPK(String id) {
assertObjectNotNull("id", id);
BsSearchFieldLogCB cb = this;
cb.query().docMeta().setId_Equal(id);
return (SearchFieldLogCB) this;
}
@Override
public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) {
acceptPK((String) primaryKeyMap.get("_id"));
}
// ===================================================================================
// Build
// =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
if (_conditionQuery != null) {
QueryBuilder queryBuilder = _conditionQuery.getQuery();
if (queryBuilder != null) {
builder.setQuery(queryBuilder);
}
_conditionQuery.getFieldSortBuilderList().forEach(sort -> {
builder.addSort(sort);
});
}
if (_conditionAggregation != null) {
_conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
}
if (_specification != null) {
builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
}
return builder;
}
// ===================================================================================
// Query
// =====
public BsSearchFieldLogCQ query() {
assertQueryPurpose();
return doGetConditionQuery();
}
protected BsSearchFieldLogCQ doGetConditionQuery() {
if (_conditionQuery == null) {
_conditionQuery = createLocalCQ();
}
return _conditionQuery;
}
protected BsSearchFieldLogCQ createLocalCQ() {
return new SearchFieldLogCQ();
}
// ===================================================================================
// Aggregation
// ===========
public BsSearchFieldLogCA aggregation() {
assertAggregationPurpose();
return doGetConditionAggregation();
}
protected BsSearchFieldLogCA doGetConditionAggregation() {
if (_conditionAggregation == null) {
_conditionAggregation = createLocalCA();
}
return _conditionAggregation;
}
protected BsSearchFieldLogCA createLocalCA() {
return new SearchFieldLogCA();
}
// ===================================================================================
// Specify
// =======
public HpSpecification specify() {
assertSpecifyPurpose();
if (_specification == null) {
_specification = new HpSpecification();
}
return _specification;
}
protected void assertQueryPurpose() {
}
protected void assertAggregationPurpose() {
}
protected void assertSpecifyPurpose() {
}
public static class HpSpecification {
private List<String> columnList = new ArrayList<>();
private void doColumn(String name) {
columnList.add(name);
}
public void columnId() {
doColumn("_id");
}
public void columnName() {
doColumn("name");
}
public void columnSearchLogId() {
doColumn("searchLogId");
}
public void columnValue() {
doColumn("value");
}
public void columnRequestedAt() {
doColumn("requestedAt");
}
}
}

View file

@ -243,5 +243,9 @@ public class BsSearchLogCB extends EsAbstractConditionBean {
public void columnLanguages() {
doColumn("languages");
}
public void columnVirtualHost() {
doColumn("virtualHost");
}
}
}

View file

@ -1,24 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.cbean.ca;
import org.codelibs.fess.es.log.cbean.ca.bs.BsSearchFieldLogCA;
/**
* @author ESFlute (using FreeGen)
*/
public class SearchFieldLogCA extends BsSearchFieldLogCA {
}

View file

@ -1,601 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.cbean.ca.bs;
import org.codelibs.fess.es.log.allcommon.EsAbstractConditionAggregation;
import org.codelibs.fess.es.log.allcommon.EsAbstractConditionQuery;
import org.codelibs.fess.es.log.cbean.ca.SearchFieldLogCA;
import org.codelibs.fess.es.log.cbean.cq.SearchFieldLogCQ;
import org.codelibs.fess.es.log.cbean.cq.bs.BsSearchFieldLogCQ;
import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.missing.MissingAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.range.date.DateRangeAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.range.ip.IpRangeAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.significant.SignificantTermsAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.elasticsearch.search.aggregations.metrics.cardinality.CardinalityAggregationBuilder;
import org.elasticsearch.search.aggregations.metrics.scripted.ScriptedMetricAggregationBuilder;
import org.elasticsearch.search.aggregations.metrics.tophits.TopHitsAggregationBuilder;
import org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountAggregationBuilder;
/**
* @author ESFlute (using FreeGen)
*/
public abstract class BsSearchFieldLogCA extends EsAbstractConditionAggregation {
// ===================================================================================
// Aggregation Set
// =========
public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsSearchFieldLogCQ> queryLambda,
ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
SearchFieldLogCQ cq = new SearchFieldLogCQ();
if (queryLambda != null) {
queryLambda.callback(cq);
}
FilterAggregationBuilder builder = regFilterA(name, cq.getQuery());
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void global(String name, ConditionOptionCall<GlobalAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
GlobalAggregationBuilder builder = regGlobalA(name);
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void sampler(String name, ConditionOptionCall<SamplerAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
SamplerAggregationBuilder builder = regSamplerA(name);
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void scriptedMetric(String name, ConditionOptionCall<ScriptedMetricAggregationBuilder> opLambda) {
ScriptedMetricAggregationBuilder builder = regScriptedMetricA(name);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void topHits(String name, ConditionOptionCall<TopHitsAggregationBuilder> opLambda) {
TopHitsAggregationBuilder builder = regTopHitsA(name);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setName_Terms() {
setName_Terms(null);
}
public void setName_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda) {
setName_Terms("name", opLambda, null);
}
public void setName_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setName_Terms("name", opLambda, aggsLambda);
}
public void setName_Terms(String name, ConditionOptionCall<TermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
TermsAggregationBuilder builder = regTermsA(name, "name");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setName_SignificantTerms() {
setName_SignificantTerms(null);
}
public void setName_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda) {
setName_SignificantTerms("name", opLambda, null);
}
public void setName_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setName_SignificantTerms("name", opLambda, aggsLambda);
}
public void setName_SignificantTerms(String name, ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
SignificantTermsAggregationBuilder builder = regSignificantTermsA(name, "name");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setName_IpRange() {
setName_IpRange(null);
}
public void setName_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda) {
setName_IpRange("name", opLambda, null);
}
public void setName_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setName_IpRange("name", opLambda, aggsLambda);
}
public void setName_IpRange(String name, ConditionOptionCall<IpRangeAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
IpRangeAggregationBuilder builder = regIpRangeA(name, "name");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setName_Count() {
setName_Count(null);
}
public void setName_Count(ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
setName_Count("name", opLambda);
}
public void setName_Count(String name, ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
ValueCountAggregationBuilder builder = regCountA(name, "name");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setName_Cardinality() {
setName_Cardinality(null);
}
public void setName_Cardinality(ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
setName_Cardinality("name", opLambda);
}
public void setName_Cardinality(String name, ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
CardinalityAggregationBuilder builder = regCardinalityA(name, "name");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setName_Missing() {
setName_Missing(null);
}
public void setName_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda) {
setName_Missing("name", opLambda, null);
}
public void setName_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setName_Missing("name", opLambda, aggsLambda);
}
public void setName_Missing(String name, ConditionOptionCall<MissingAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
MissingAggregationBuilder builder = regMissingA(name, "name");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setSearchLogId_Terms() {
setSearchLogId_Terms(null);
}
public void setSearchLogId_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda) {
setSearchLogId_Terms("searchLogId", opLambda, null);
}
public void setSearchLogId_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setSearchLogId_Terms("searchLogId", opLambda, aggsLambda);
}
public void setSearchLogId_Terms(String name, ConditionOptionCall<TermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
TermsAggregationBuilder builder = regTermsA(name, "searchLogId");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setSearchLogId_SignificantTerms() {
setSearchLogId_SignificantTerms(null);
}
public void setSearchLogId_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda) {
setSearchLogId_SignificantTerms("searchLogId", opLambda, null);
}
public void setSearchLogId_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setSearchLogId_SignificantTerms("searchLogId", opLambda, aggsLambda);
}
public void setSearchLogId_SignificantTerms(String name, ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
SignificantTermsAggregationBuilder builder = regSignificantTermsA(name, "searchLogId");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setSearchLogId_IpRange() {
setSearchLogId_IpRange(null);
}
public void setSearchLogId_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda) {
setSearchLogId_IpRange("searchLogId", opLambda, null);
}
public void setSearchLogId_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setSearchLogId_IpRange("searchLogId", opLambda, aggsLambda);
}
public void setSearchLogId_IpRange(String name, ConditionOptionCall<IpRangeAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
IpRangeAggregationBuilder builder = regIpRangeA(name, "searchLogId");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setSearchLogId_Count() {
setSearchLogId_Count(null);
}
public void setSearchLogId_Count(ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
setSearchLogId_Count("searchLogId", opLambda);
}
public void setSearchLogId_Count(String name, ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
ValueCountAggregationBuilder builder = regCountA(name, "searchLogId");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setSearchLogId_Cardinality() {
setSearchLogId_Cardinality(null);
}
public void setSearchLogId_Cardinality(ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
setSearchLogId_Cardinality("searchLogId", opLambda);
}
public void setSearchLogId_Cardinality(String name, ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
CardinalityAggregationBuilder builder = regCardinalityA(name, "searchLogId");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setSearchLogId_Missing() {
setSearchLogId_Missing(null);
}
public void setSearchLogId_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda) {
setSearchLogId_Missing("searchLogId", opLambda, null);
}
public void setSearchLogId_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setSearchLogId_Missing("searchLogId", opLambda, aggsLambda);
}
public void setSearchLogId_Missing(String name, ConditionOptionCall<MissingAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
MissingAggregationBuilder builder = regMissingA(name, "searchLogId");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setValue_Terms() {
setValue_Terms(null);
}
public void setValue_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda) {
setValue_Terms("value", opLambda, null);
}
public void setValue_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setValue_Terms("value", opLambda, aggsLambda);
}
public void setValue_Terms(String name, ConditionOptionCall<TermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
TermsAggregationBuilder builder = regTermsA(name, "value");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setValue_SignificantTerms() {
setValue_SignificantTerms(null);
}
public void setValue_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda) {
setValue_SignificantTerms("value", opLambda, null);
}
public void setValue_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setValue_SignificantTerms("value", opLambda, aggsLambda);
}
public void setValue_SignificantTerms(String name, ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
SignificantTermsAggregationBuilder builder = regSignificantTermsA(name, "value");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setValue_IpRange() {
setValue_IpRange(null);
}
public void setValue_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda) {
setValue_IpRange("value", opLambda, null);
}
public void setValue_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setValue_IpRange("value", opLambda, aggsLambda);
}
public void setValue_IpRange(String name, ConditionOptionCall<IpRangeAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
IpRangeAggregationBuilder builder = regIpRangeA(name, "value");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setValue_Count() {
setValue_Count(null);
}
public void setValue_Count(ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
setValue_Count("value", opLambda);
}
public void setValue_Count(String name, ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
ValueCountAggregationBuilder builder = regCountA(name, "value");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setValue_Cardinality() {
setValue_Cardinality(null);
}
public void setValue_Cardinality(ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
setValue_Cardinality("value", opLambda);
}
public void setValue_Cardinality(String name, ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
CardinalityAggregationBuilder builder = regCardinalityA(name, "value");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setValue_Missing() {
setValue_Missing(null);
}
public void setValue_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda) {
setValue_Missing("value", opLambda, null);
}
public void setValue_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setValue_Missing("value", opLambda, aggsLambda);
}
public void setValue_Missing(String name, ConditionOptionCall<MissingAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
MissingAggregationBuilder builder = regMissingA(name, "value");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setRequestedAt_DateRange() {
setRequestedAt_DateRange(null);
}
public void setRequestedAt_DateRange(ConditionOptionCall<DateRangeAggregationBuilder> opLambda) {
setRequestedAt_DateRange("requestedAt", opLambda, null);
}
public void setRequestedAt_DateRange(ConditionOptionCall<DateRangeAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setRequestedAt_DateRange("requestedAt", opLambda, aggsLambda);
}
public void setRequestedAt_DateRange(String name, ConditionOptionCall<DateRangeAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
DateRangeAggregationBuilder builder = regDateRangeA(name, "requestedAt");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setRequestedAt_DateHistogram() {
setRequestedAt_DateHistogram(null);
}
public void setRequestedAt_DateHistogram(ConditionOptionCall<DateHistogramAggregationBuilder> opLambda) {
setRequestedAt_DateHistogram("requestedAt", opLambda, null);
}
public void setRequestedAt_DateHistogram(ConditionOptionCall<DateHistogramAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setRequestedAt_DateHistogram("requestedAt", opLambda, aggsLambda);
}
public void setRequestedAt_DateHistogram(String name, ConditionOptionCall<DateHistogramAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
DateHistogramAggregationBuilder builder = regDateHistogramA(name, "requestedAt");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setRequestedAt_Count() {
setRequestedAt_Count(null);
}
public void setRequestedAt_Count(ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
setRequestedAt_Count("requestedAt", opLambda);
}
public void setRequestedAt_Count(String name, ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
ValueCountAggregationBuilder builder = regCountA(name, "requestedAt");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setRequestedAt_Cardinality() {
setRequestedAt_Cardinality(null);
}
public void setRequestedAt_Cardinality(ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
setRequestedAt_Cardinality("requestedAt", opLambda);
}
public void setRequestedAt_Cardinality(String name, ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
CardinalityAggregationBuilder builder = regCardinalityA(name, "requestedAt");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setRequestedAt_Missing() {
setRequestedAt_Missing(null);
}
public void setRequestedAt_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda) {
setRequestedAt_Missing("requestedAt", opLambda, null);
}
public void setRequestedAt_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda, OperatorCall<BsSearchFieldLogCA> aggsLambda) {
setRequestedAt_Missing("requestedAt", opLambda, aggsLambda);
}
public void setRequestedAt_Missing(String name, ConditionOptionCall<MissingAggregationBuilder> opLambda,
OperatorCall<BsSearchFieldLogCA> aggsLambda) {
MissingAggregationBuilder builder = regMissingA(name, "requestedAt");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchFieldLogCA ca = new SearchFieldLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
}

View file

@ -2772,4 +2772,135 @@ public abstract class BsSearchLogCA extends EsAbstractConditionAggregation {
}
}
public void setVirtualHost_Terms() {
setVirtualHost_Terms(null);
}
public void setVirtualHost_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda) {
setVirtualHost_Terms("virtualHost", opLambda, null);
}
public void setVirtualHost_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda, OperatorCall<BsSearchLogCA> aggsLambda) {
setVirtualHost_Terms("virtualHost", opLambda, aggsLambda);
}
public void setVirtualHost_Terms(String name, ConditionOptionCall<TermsAggregationBuilder> opLambda,
OperatorCall<BsSearchLogCA> aggsLambda) {
TermsAggregationBuilder builder = regTermsA(name, "virtualHost");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchLogCA ca = new SearchLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setVirtualHost_SignificantTerms() {
setVirtualHost_SignificantTerms(null);
}
public void setVirtualHost_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda) {
setVirtualHost_SignificantTerms("virtualHost", opLambda, null);
}
public void setVirtualHost_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
OperatorCall<BsSearchLogCA> aggsLambda) {
setVirtualHost_SignificantTerms("virtualHost", opLambda, aggsLambda);
}
public void setVirtualHost_SignificantTerms(String name, ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
OperatorCall<BsSearchLogCA> aggsLambda) {
SignificantTermsAggregationBuilder builder = regSignificantTermsA(name, "virtualHost");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchLogCA ca = new SearchLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setVirtualHost_IpRange() {
setVirtualHost_IpRange(null);
}
public void setVirtualHost_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda) {
setVirtualHost_IpRange("virtualHost", opLambda, null);
}
public void setVirtualHost_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda, OperatorCall<BsSearchLogCA> aggsLambda) {
setVirtualHost_IpRange("virtualHost", opLambda, aggsLambda);
}
public void setVirtualHost_IpRange(String name, ConditionOptionCall<IpRangeAggregationBuilder> opLambda,
OperatorCall<BsSearchLogCA> aggsLambda) {
IpRangeAggregationBuilder builder = regIpRangeA(name, "virtualHost");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchLogCA ca = new SearchLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
public void setVirtualHost_Count() {
setVirtualHost_Count(null);
}
public void setVirtualHost_Count(ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
setVirtualHost_Count("virtualHost", opLambda);
}
public void setVirtualHost_Count(String name, ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
ValueCountAggregationBuilder builder = regCountA(name, "virtualHost");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_Cardinality() {
setVirtualHost_Cardinality(null);
}
public void setVirtualHost_Cardinality(ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
setVirtualHost_Cardinality("virtualHost", opLambda);
}
public void setVirtualHost_Cardinality(String name, ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
CardinalityAggregationBuilder builder = regCardinalityA(name, "virtualHost");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_Missing() {
setVirtualHost_Missing(null);
}
public void setVirtualHost_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda) {
setVirtualHost_Missing("virtualHost", opLambda, null);
}
public void setVirtualHost_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda, OperatorCall<BsSearchLogCA> aggsLambda) {
setVirtualHost_Missing("virtualHost", opLambda, aggsLambda);
}
public void setVirtualHost_Missing(String name, ConditionOptionCall<MissingAggregationBuilder> opLambda,
OperatorCall<BsSearchLogCA> aggsLambda) {
MissingAggregationBuilder builder = regMissingA(name, "virtualHost");
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchLogCA ca = new SearchLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
}

View file

@ -1,24 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.cbean.cq;
import org.codelibs.fess.es.log.cbean.cq.bs.BsSearchFieldLogCQ;
/**
* @author ESFlute (using FreeGen)
*/
public class SearchFieldLogCQ extends BsSearchFieldLogCQ {
}

View file

@ -3695,4 +3695,226 @@ public abstract class BsSearchLogCQ extends EsAbstractConditionQuery {
return this;
}
public void setVirtualHost_Equal(String virtualHost) {
setVirtualHost_Term(virtualHost, null);
}
public void setVirtualHost_Equal(String virtualHost, ConditionOptionCall<TermQueryBuilder> opLambda) {
setVirtualHost_Term(virtualHost, opLambda);
}
public void setVirtualHost_Term(String virtualHost) {
setVirtualHost_Term(virtualHost, null);
}
public void setVirtualHost_Term(String virtualHost, ConditionOptionCall<TermQueryBuilder> opLambda) {
TermQueryBuilder builder = regTermQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_NotEqual(String virtualHost) {
setVirtualHost_NotTerm(virtualHost, null);
}
public void setVirtualHost_NotTerm(String virtualHost) {
setVirtualHost_NotTerm(virtualHost, null);
}
public void setVirtualHost_NotEqual(String virtualHost, ConditionOptionCall<BoolQueryBuilder> opLambda) {
setVirtualHost_NotTerm(virtualHost, opLambda);
}
public void setVirtualHost_NotTerm(String virtualHost, ConditionOptionCall<BoolQueryBuilder> opLambda) {
not(not -> not.setVirtualHost_Term(virtualHost), opLambda);
}
public void setVirtualHost_Terms(Collection<String> virtualHostList) {
setVirtualHost_Terms(virtualHostList, null);
}
public void setVirtualHost_Terms(Collection<String> virtualHostList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
TermsQueryBuilder builder = regTermsQ("virtualHost", virtualHostList);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_InScope(Collection<String> virtualHostList) {
setVirtualHost_Terms(virtualHostList, null);
}
public void setVirtualHost_InScope(Collection<String> virtualHostList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
setVirtualHost_Terms(virtualHostList, opLambda);
}
public void setVirtualHost_Match(String virtualHost) {
setVirtualHost_Match(virtualHost, null);
}
public void setVirtualHost_Match(String virtualHost, ConditionOptionCall<MatchQueryBuilder> opLambda) {
MatchQueryBuilder builder = regMatchQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_MatchPhrase(String virtualHost) {
setVirtualHost_MatchPhrase(virtualHost, null);
}
public void setVirtualHost_MatchPhrase(String virtualHost, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
MatchPhraseQueryBuilder builder = regMatchPhraseQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_MatchPhrasePrefix(String virtualHost) {
setVirtualHost_MatchPhrasePrefix(virtualHost, null);
}
public void setVirtualHost_MatchPhrasePrefix(String virtualHost, ConditionOptionCall<MatchPhrasePrefixQueryBuilder> opLambda) {
MatchPhrasePrefixQueryBuilder builder = regMatchPhrasePrefixQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_Fuzzy(String virtualHost) {
setVirtualHost_Fuzzy(virtualHost, null);
}
public void setVirtualHost_Fuzzy(String virtualHost, ConditionOptionCall<MatchQueryBuilder> opLambda) {
MatchQueryBuilder builder = regFuzzyQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_Prefix(String virtualHost) {
setVirtualHost_Prefix(virtualHost, null);
}
public void setVirtualHost_Prefix(String virtualHost, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
PrefixQueryBuilder builder = regPrefixQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_Wildcard(String virtualHost) {
setVirtualHost_Wildcard(virtualHost, null);
}
public void setVirtualHost_Wildcard(String virtualHost, ConditionOptionCall<WildcardQueryBuilder> opLambda) {
WildcardQueryBuilder builder = regWildcardQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_Regexp(String virtualHost) {
setVirtualHost_Regexp(virtualHost, null);
}
public void setVirtualHost_Regexp(String virtualHost, ConditionOptionCall<RegexpQueryBuilder> opLambda) {
RegexpQueryBuilder builder = regRegexpQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_SpanTerm(String virtualHost) {
setVirtualHost_SpanTerm("virtualHost", null);
}
public void setVirtualHost_SpanTerm(String virtualHost, ConditionOptionCall<SpanTermQueryBuilder> opLambda) {
SpanTermQueryBuilder builder = regSpanTermQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_GreaterThan(String virtualHost) {
setVirtualHost_GreaterThan(virtualHost, null);
}
public void setVirtualHost_GreaterThan(String virtualHost, ConditionOptionCall<RangeQueryBuilder> opLambda) {
final Object _value = virtualHost;
RangeQueryBuilder builder = regRangeQ("virtualHost", ConditionKey.CK_GREATER_THAN, _value);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_LessThan(String virtualHost) {
setVirtualHost_LessThan(virtualHost, null);
}
public void setVirtualHost_LessThan(String virtualHost, ConditionOptionCall<RangeQueryBuilder> opLambda) {
final Object _value = virtualHost;
RangeQueryBuilder builder = regRangeQ("virtualHost", ConditionKey.CK_LESS_THAN, _value);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_GreaterEqual(String virtualHost) {
setVirtualHost_GreaterEqual(virtualHost, null);
}
public void setVirtualHost_GreaterEqual(String virtualHost, ConditionOptionCall<RangeQueryBuilder> opLambda) {
final Object _value = virtualHost;
RangeQueryBuilder builder = regRangeQ("virtualHost", ConditionKey.CK_GREATER_EQUAL, _value);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_LessEqual(String virtualHost) {
setVirtualHost_LessEqual(virtualHost, null);
}
public void setVirtualHost_LessEqual(String virtualHost, ConditionOptionCall<RangeQueryBuilder> opLambda) {
final Object _value = virtualHost;
RangeQueryBuilder builder = regRangeQ("virtualHost", ConditionKey.CK_LESS_EQUAL, _value);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_Exists() {
setVirtualHost_Exists(null);
}
public void setVirtualHost_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
ExistsQueryBuilder builder = regExistsQ("virtualHost");
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void setVirtualHost_CommonTerms(String virtualHost) {
setVirtualHost_CommonTerms(virtualHost, null);
}
public void setVirtualHost_CommonTerms(String virtualHost, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
CommonTermsQueryBuilder builder = regCommonTermsQ("virtualHost", virtualHost);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public BsSearchLogCQ addOrderBy_VirtualHost_Asc() {
regOBA("virtualHost");
return this;
}
public BsSearchLogCQ addOrderBy_VirtualHost_Desc() {
regOBD("virtualHost");
return this;
}
}

View file

@ -1,29 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.exbhv;
import org.codelibs.fess.es.log.bsbhv.BsSearchFieldLogBhv;
import org.codelibs.fess.util.ComponentUtil;
/**
* @author FreeGen
*/
public class SearchFieldLogBhv extends BsSearchFieldLogBhv {
@Override
protected String asEsIndex() {
return ComponentUtil.getFessConfig().getIndexLogIndex();
}
}

View file

@ -20,9 +20,13 @@ import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Map;
import org.codelibs.core.misc.Pair;
import org.codelibs.fess.es.log.bsbhv.BsSearchLogBhv;
import org.codelibs.fess.es.log.exentity.SearchLog;
import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.util.DfTypeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -52,4 +56,20 @@ public class SearchLogBhv extends BsSearchLogBhv {
return DfTypeUtil.toLocalDateTime(value);
}
@Override
protected <RESULT extends SearchLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
final Object searchFieldObj = source.get("searchField");
if (searchFieldObj instanceof Map) {
((Map<String, String>) searchFieldObj).entrySet().stream()
.forEach(e -> result.getSearchFieldLogList().add(new Pair(e.getKey(), e.getValue())));
}
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
}

View file

@ -1,64 +0,0 @@
/*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fess.es.log.exentity;
import java.util.Map;
import org.codelibs.fess.es.log.bsentity.BsSearchFieldLog;
/**
* @author FreeGen
*/
public class SearchFieldLog extends BsSearchFieldLog {
private static final long serialVersionUID = 1L;
private Map<String, Object> fields;
public String getId() {
return asDocMeta().id();
}
public void setId(final String id) {
asDocMeta().id(id);
}
public Long getVersionNo() {
return asDocMeta().version();
}
public void setVersionNo(final Long version) {
asDocMeta().version(version);
}
public void addField(final String key, final Object value) {
fields.put(key, value);
}
@Override
public Map<String, Object> toSource() {
final Map<String, Object> sourceMap = super.toSource();
if (fields != null) {
sourceMap.putAll(fields);
}
return sourceMap;
}
@Override
public String toString() {
return "SearchFieldLog [name=" + name + ", searchLogId=" + searchLogId + ", value=" + value + ", docMeta=" + docMeta + "]";
}
}

View file

@ -23,11 +23,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.core.misc.Pair;
import org.codelibs.fess.Constants;
import org.codelibs.fess.es.log.bsentity.BsSearchLog;
import org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv;
import org.codelibs.fess.es.log.exbhv.UserInfoBhv;
import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.optional.OptionalEntity;
@ -39,7 +40,7 @@ public class SearchLog extends BsSearchLog {
private static final long serialVersionUID = 1L;
private List<SearchFieldLog> searchFieldLogList;
private List<Pair<String, String>> searchFieldLogList = new ArrayList<>();
private OptionalEntity<UserInfo> userInfo;
@ -61,20 +62,9 @@ public class SearchLog extends BsSearchLog {
asDocMeta().version(version);
}
public void setClickLogList(final List<ClickLog> clickLogList) {
}
public void addSearchFieldLogValue(final String name, final String value) {
if (StringUtil.isNotBlank(name) && StringUtil.isNotBlank(value)) {
final SearchFieldLog fieldLog = new SearchFieldLog();
fieldLog.setName(name);
fieldLog.setValue(value);
fieldLog.setRequestedAt(getRequestedAt());
if (searchFieldLogList == null) {
searchFieldLogList = new ArrayList<>();
}
searchFieldLogList.add(fieldLog);
searchFieldLogList.add(new Pair<String, String>(name, value));
}
}
@ -96,14 +86,7 @@ public class SearchLog extends BsSearchLog {
this.userInfo = userInfo;
}
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());
});
}
public List<Pair<String, String>> getSearchFieldLogList() {
return searchFieldLogList;
}
@ -117,6 +100,8 @@ public class SearchLog extends BsSearchLog {
if (fields != null) {
sourceMap.putAll(fields);
}
final Map<String, String> searchFieldMap = searchFieldLogList.stream().collect(Collectors.toMap(Pair::getFirst, Pair::getSecond));
sourceMap.put("searchField", searchFieldMap);
return sourceMap;
}

View file

@ -37,11 +37,9 @@ import org.codelibs.fess.entity.SearchRequestParams;
import org.codelibs.fess.entity.SearchRequestParams.SearchRequestType;
import org.codelibs.fess.es.log.exbhv.ClickLogBhv;
import org.codelibs.fess.es.log.exbhv.FavoriteLogBhv;
import org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv;
import org.codelibs.fess.es.log.exbhv.SearchLogBhv;
import org.codelibs.fess.es.log.exbhv.UserInfoBhv;
import org.codelibs.fess.es.log.exentity.ClickLog;
import org.codelibs.fess.es.log.exentity.SearchFieldLog;
import org.codelibs.fess.es.log.exentity.SearchLog;
import org.codelibs.fess.es.log.exentity.UserInfo;
import org.codelibs.fess.mylasta.action.FessUserBean;
@ -120,15 +118,22 @@ public class SearchLogHelper {
if (languages != null) {
searchLog.setLanguages(StringUtils.join((String[]) languages, ","));
} else {
searchLog.setLanguages("");
searchLog.setLanguages(StringUtil.EMPTY);
}
final String virtualHostKey = ComponentUtil.getFessConfig().getVirtualHostKey();
if (virtualHostKey != null) {
searchLog.setVirtualHost(virtualHostKey);
} else {
searchLog.setVirtualHost(StringUtil.EMPTY);
}
@SuppressWarnings("unchecked")
final Map<String, List<String>> fieldLogMap = (Map<String, List<String>>) request.getAttribute(Constants.FIELD_LOGS);
if (fieldLogMap != null) {
final int queryMaxLength = ComponentUtil.getFessConfig().getQueryMaxLengthAsInteger();
for (final Map.Entry<String, List<String>> logEntry : fieldLogMap.entrySet()) {
for (final String value : logEntry.getValue()) {
searchLog.addSearchFieldLogValue(logEntry.getKey(), StringUtils.abbreviate(value, 1000));
searchLog.addSearchFieldLogValue(logEntry.getKey(), StringUtils.abbreviate(value, queryMaxLength));
}
}
}
@ -258,18 +263,9 @@ public class SearchLogHelper {
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);
});
}
protected void processClickLogQueue(final Queue<ClickLog> queue) {

View file

@ -32,13 +32,13 @@ import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.core.misc.Pair;
import org.codelibs.fess.es.client.FessEsClient;
import org.codelibs.fess.es.config.exbhv.BadWordBhv;
import org.codelibs.fess.es.config.exbhv.ElevateWordBhv;
import org.codelibs.fess.es.config.exentity.BadWord;
import org.codelibs.fess.es.config.exentity.ElevateWord;
import org.codelibs.fess.es.log.exbhv.SearchLogBhv;
import org.codelibs.fess.es.log.exentity.SearchFieldLog;
import org.codelibs.fess.es.log.exentity.SearchLog;
import org.codelibs.fess.mylasta.direction.FessConfig;
import org.codelibs.fess.suggest.Suggester;
@ -147,18 +147,18 @@ public class SuggestHelper {
final List<String> tags = new ArrayList<>();
final List<String> roles = new ArrayList<>();
for (final SearchFieldLog searchFieldLog : searchLog.getSearchFieldLogList()) {
final String name = searchFieldLog.getName();
for (final Pair<String, String> searchFieldLog : searchLog.getSearchFieldLogList()) {
final String name = searchFieldLog.getFirst();
if (contentFieldNameSet.contains(name)) {
if (sb.length() > 0) {
sb.append(TEXT_SEP);
}
sb.append(searchFieldLog.getValue());
sb.append(searchFieldLog.getSecond());
fields.add(name);
} else if (tagFieldNameSet.contains(name)) {
tags.add(searchFieldLog.getValue());
tags.add(searchFieldLog.getSecond());
} else if (roleFieldNameSet.contains(name)) {
roles.add(searchFieldLog.getValue());
roles.add(searchFieldLog.getSecond());
}
}

View file

@ -620,7 +620,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/** The key of the configuration. e.g. .fess_basic_config.bulk,.fess_config.bulk,.fess_user.bulk,system.properties */
String INDEX_BACKUP_TARGETS = "index.backup.targets";
/** The key of the configuration. e.g. click_log.csv,favorite_log.csv,search_log.csv,search_field_log.csv,user_info.csv */
/** The key of the configuration. e.g. click_log.csv,favorite_log.csv,search_log.csv,user_info.csv */
String INDEX_BACKUP_LOG_TARGETS = "index.backup.log.targets";
/** The key of the configuration. e.g. 4000 */
@ -3078,7 +3078,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/**
* Get the value for the key 'index.backup.log.targets'. <br>
* The value is, e.g. click_log.csv,favorite_log.csv,search_log.csv,search_field_log.csv,user_info.csv <br>
* The value is, e.g. click_log.csv,favorite_log.csv,search_log.csv,user_info.csv <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getIndexBackupLogTargets();
@ -7553,8 +7553,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
defaultMap.put(FessConfig.SMB_ROLE_FROM_FILE, "true");
defaultMap.put(FessConfig.SMB_AVAILABLE_SID_TYPES, "1,2");
defaultMap.put(FessConfig.INDEX_BACKUP_TARGETS, ".fess_basic_config.bulk,.fess_config.bulk,.fess_user.bulk,system.properties");
defaultMap.put(FessConfig.INDEX_BACKUP_LOG_TARGETS,
"click_log.csv,favorite_log.csv,search_log.csv,search_field_log.csv,user_info.csv");
defaultMap.put(FessConfig.INDEX_BACKUP_LOG_TARGETS, "click_log.csv,favorite_log.csv,search_log.csv,user_info.csv");
defaultMap.put(FessConfig.FORM_ADMIN_MAX_INPUT_SIZE, "4000");
defaultMap.put(FessConfig.AUTHENTICATION_ADMIN_USERS, "admin");
defaultMap.put(FessConfig.AUTHENTICATION_ADMIN_ROLES, "admin");

View file

@ -271,9 +271,6 @@
<postConstruct name="addIndexConfig">
<arg>"fess_log/favorite_log"</arg>
</postConstruct>
<postConstruct name="addIndexConfig">
<arg>"fess_log/search_field_log"</arg>
</postConstruct>
<postConstruct name="addIndexConfig">
<arg>"fess_log/search_log"</arg>
</postConstruct>

View file

@ -11,7 +11,6 @@
<!-- The components of Behavior. -->
<component name="clickLogBhv" class="org.codelibs.fess.es.log.exbhv.ClickLogBhv"/>
<component name="favoriteLogBhv" class="org.codelibs.fess.es.log.exbhv.FavoriteLogBhv"/>
<component name="searchFieldLogBhv" class="org.codelibs.fess.es.log.exbhv.SearchFieldLogBhv"/>
<component name="searchLogBhv" class="org.codelibs.fess.es.log.exbhv.SearchLogBhv"/>
<component name="userInfoBhv" class="org.codelibs.fess.es.log.exbhv.UserInfoBhv"/>
</components>

View file

@ -315,7 +315,7 @@ smb.available.sid.types=1,2
# backup
index.backup.targets=.fess_basic_config.bulk,.fess_config.bulk,.fess_user.bulk,system.properties
index.backup.log.targets=click_log.csv,favorite_log.csv,search_log.csv,search_field_log.csv,user_info.csv
index.backup.log.targets=click_log.csv,favorite_log.csv,search_log.csv,user_info.csv
# ========================================================================================
# Web

View file

@ -1,25 +0,0 @@
{
"search_field_log": {
"_source": {
"enabled": true
},
"_all": {
"enabled": false
},
"properties": {
"searchLogId": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"value": {
"type": "keyword"
},
"requestedAt": {
"type": "date",
"format": "date_optional_time"
}
}
}
}

View file

@ -6,6 +6,16 @@
"_all": {
"enabled": false
},
"dynamic_templates": [
{
"search_fields": {
"path_match": "searchField.*",
"mapping": {
"type": "keyword"
}
}
}
],
"properties": {
"user": {
"type": "keyword"
@ -58,6 +68,9 @@
},
"languages" : {
"type" : "keyword"
},
"virtualHost" : {
"type" : "keyword"
}
}
}