Class SearchLogService

java.lang.Object
org.codelibs.fess.app.service.SearchLogService

public class SearchLogService extends Object
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 Details

    • fessConfig

      protected org.codelibs.fess.mylasta.direction.FessConfig fessConfig
      Fess 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

      public List<?> getSearchLogList(SearchLogPager pager)
      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

      protected LocalDateTime parseDateTime(String value, DateTimeFormatter formatter)
      Parses a date/time string and converts it to UTC timezone.
      Parameters:
      value - The date/time string to parse
      formatter - The date/time formatter to use
      Returns:
      LocalDateTime in UTC timezone
    • getSearchLog

      public org.dbflute.optional.OptionalEntity<?> getSearchLog(String logType, String id)
      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

      public Map<String,String> getSearchLogMap(String logType, String id)
      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

      public void deleteSearchLog(Object e)
      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