Package org.codelibs.fess.app.service
Class SearchLogService
java.lang.Object
org.codelibs.fess.app.service.SearchLogService
Service class for managing search logs and related analytics.
This service provides functionality for querying, aggregating, and managing
various types of search logs including search logs, click logs, favorite logs,
and user information logs. It supports different aggregation types for
analytics and reporting purposes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.codelibs.fess.mylasta.direction.FessConfigFess configuration settings. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for creating a new SearchLogService instance. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteBefore(int days) Deletes search logs older than the specified number of days.voiddeleteClickLogBefore(int days) Deletes click logs older than the specified number of days.voiddeleteFavoriteLogBefore(int days) Deletes favorite logs older than the specified number of days.voidDeletes a search log entry based on its type.org.dbflute.optional.OptionalEntity<?> getSearchLog(String logType, String id) Retrieves a specific search log entry by log type and ID.List<?> getSearchLogList(SearchLogPager pager) Retrieves a list of search logs based on the specified pager criteria.getSearchLogMap(String logType, String id) Retrieves a search log entry as a formatted map of field names and values.protected LocalDateTimeparseDateTime(String value, DateTimeFormatter formatter) Parses a date/time string and converts it to UTC timezone.
-
Field Details
-
fessConfig
protected org.codelibs.fess.mylasta.direction.FessConfig fessConfigFess configuration settings.
-
-
Constructor Details
-
SearchLogService
public SearchLogService()Default constructor for creating a new SearchLogService instance.
-
-
Method Details
-
deleteBefore
public void deleteBefore(int days) Deletes search logs older than the specified number of days.- Parameters:
days- Number of days to keep (logs older than this will be deleted)
-
deleteClickLogBefore
public void deleteClickLogBefore(int days) Deletes click logs older than the specified number of days.- Parameters:
days- Number of days to keep (logs older than this will be deleted)
-
deleteFavoriteLogBefore
public void deleteFavoriteLogBefore(int days) Deletes favorite logs older than the specified number of days.- Parameters:
days- Number of days to keep (logs older than this will be deleted)
-
getSearchLogList
Retrieves a list of search logs based on the specified pager criteria. This method supports various log types including search logs, click logs, favorite logs, user information, and different aggregation types for analytics.- Parameters:
pager- The search log pager containing filter criteria and pagination settings- Returns:
- List of search log entries or aggregated data based on the log type
-
parseDateTime
Parses a date/time string and converts it to UTC timezone.- Parameters:
value- The date/time string to parseformatter- The date/time formatter to use- Returns:
- LocalDateTime in UTC timezone
-
getSearchLog
Retrieves a specific search log entry by log type and ID.- Parameters:
logType- The type of log to retrieve (search, click, favorite, userinfo)id- The ID of the log entry- Returns:
- Optional entity containing the log entry if found
-
getSearchLogMap
Retrieves a search log entry as a formatted map of field names and values.- Parameters:
logType- The type of log to retrieve (search, click, favorite, userinfo)id- The ID of the log entry- Returns:
- Map containing formatted field names and values for display
-
deleteSearchLog
Deletes a search log entry based on its type.- Parameters:
e- The log entity to delete (ClickLog, FavoriteLog, UserInfo, or SearchLog)- Throws:
FessSystemException- if the entity type is not recognized
-