Class SearchLog

java.lang.Object
com.atlan.model.search.CompoundQuery
com.atlan.model.search.SearchLog

public class SearchLog extends CompoundQuery
Search abstraction mechanism, to simplify the most common searches against Atlan's log of past searches (removing the need to understand the guts of Elastic).
  • Field Details

    • EXCLUDE_USERS

      public static final List<String> EXCLUDE_USERS
    • VIEWED

      public static final co.elastic.clients.elasticsearch._types.query_dsl.Query VIEWED
    • SEARCHED

      public static final co.elastic.clients.elasticsearch._types.query_dsl.Query SEARCHED
  • Constructor Details

  • Method Details

    • builder

      public static SearchLog.SearchLogBuilder<?,?> builder(AtlanClient client)
      Build a search log request against the provided Atlan tenant.
      Parameters:
      client - connectivity to an Atlan tenant
      Returns:
      the start of a search log request against the tenant
    • views

      public static SearchLog.SearchLogBuilder<?,?> views(AtlanClient client)
      Start building a search log request for the views of assets.
      Parameters:
      client - connectivity to the Atlan tenant
      Returns:
      a request builder pre-configured with these criteria
    • views

      public static SearchLog.SearchLogBuilder<?,?> views(AtlanClient client, List<String> excludeUsers)
      Start building a search log request for the views of assets.
      Parameters:
      client - connectivity to the Atlan tenant
      excludeUsers - list of usernames to exclude from the results
      Returns:
      a request builder pre-configured with these criteria
    • views

      public static SearchLog.SearchLogBuilder<?,?> views(AtlanClient client, long from, long to)
      Start building a search log request for the views of assets.
      Parameters:
      client - connectivity to the Atlan tenant
      from - timestamp after which to look for any asset view activity (inclusive)
      to - timestamp up through which to look for any asset view activity (inclusive)
      Returns:
      a request builder pre-configured with these criteria
    • views

      public static SearchLog.SearchLogBuilder<?,?> views(AtlanClient client, long from, long to, List<String> excludeUsers)
      Start building a search log request for the views of assets.
      Parameters:
      client - connectivity to the Atlan tenant
      from - timestamp after which to look for any asset view activity (inclusive)
      to - timestamp up through which to look for any asset view activity (inclusive)
      excludeUsers - list of usernames to exclude from the results
      Returns:
      a request builder pre-configured with these criteria
    • searches

      public static SearchLog.SearchLogBuilder<?,?> searches(AtlanClient client)
      Start building a search log request for searches run against assets.
      Parameters:
      client - connectivity to the Atlan tenant
      Returns:
      a request builder pre-configured with these criteria
    • searches

      public static SearchLog.SearchLogBuilder<?,?> searches(AtlanClient client, List<String> excludeUsers)
      Start building a search log request for searches run against assets.
      Parameters:
      client - connectivity to the Atlan tenant
      excludeUsers - list of usernames to exclude from the results
      Returns:
      a request builder pre-configured with these criteria
    • searches

      public static SearchLog.SearchLogBuilder<?,?> searches(AtlanClient client, long from, long to)
      Start building a search log request for searches run against assets.
      Parameters:
      client - connectivity to the Atlan tenant
      from - timestamp after which to look for any search activity (inclusive)
      to - timestamp up through which to look for any search activity (inclusive)
      Returns:
      a request builder pre-configured with these criteria
    • searches

      public static SearchLog.SearchLogBuilder<?,?> searches(AtlanClient client, long from, long to, List<String> excludeUsers)
      Start building a search log request for searches run against assets.
      Parameters:
      client - connectivity to the Atlan tenant
      from - timestamp after which to look for any search activity (inclusive)
      to - timestamp up through which to look for any search activity (inclusive)
      excludeUsers - list of usernames to exclude from the results
      Returns:
      a request builder pre-configured with these criteria
    • viewsByGuid

      public static SearchLog.SearchLogBuilder<?,?> viewsByGuid(AtlanClient client, String guid)
      Start building a search log request for the views of an asset, by its GUID.
      Parameters:
      client - connectivity to the Atlan tenant
      guid - unique identifier of the asset for which to retrieve the view history
      Returns:
      a request builder pre-configured with these criteria
    • viewsByGuid

      public static SearchLog.SearchLogBuilder<?,?> viewsByGuid(AtlanClient client, String guid, List<String> excludeUsers)
      Start building a search log request for the views of an asset, by its GUID.
      Parameters:
      client - connectivity to the Atlan tenant
      guid - unique identifier of the asset for which to retrieve the view history
      excludeUsers - list of usernames to exclude from the results
      Returns:
      a request builder pre-configured with these criteria
    • mostRecentViewers

      public static List<UserViews> mostRecentViewers(AtlanClient client, String guid, int maxUsers) throws AtlanException
      Find the most recent viewers of the asset in Atlan.
      Parameters:
      client - connectivity to the Atlan tenant on which to run the search
      guid - of the asset
      maxUsers - maximum number of recent users to consider
      Returns:
      the list of users that most-recently viewed the asset, in descending order (most-recently viewed first)
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • mostRecentViewers

      public static List<UserViews> mostRecentViewers(AtlanClient client, String guid, int maxUsers, List<String> excludeUsers) throws AtlanException
      Find the most recent viewers of the asset in Atlan.
      Parameters:
      client - connectivity to the Atlan tenant on which to run the search
      guid - of the asset
      maxUsers - maximum number of recent users to consider
      excludeUsers - list of usernames to exclude from the results
      Returns:
      the list of users that most-recently viewed the asset, in descending order (most-recently viewed first)
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • mostViewedAssets

      public static List<AssetViews> mostViewedAssets(AtlanClient client, int maxAssets, boolean byDifferentUsers) throws AtlanException
      Find the most-viewed assets in Atlan.
      Parameters:
      client - connectivity to the Atlan tenant on which to run the search
      maxAssets - maximum number of assets to consider
      byDifferentUsers - when true, will consider assets viewed by more users as more important than total view count, otherwise will consider total view count most important
      Returns:
      the list of assets that are most-viewed, in descending order (most-viewed first)
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • mostViewedAssets

      public static List<AssetViews> mostViewedAssets(AtlanClient client, int maxAssets, boolean byDifferentUsers, List<String> excludeUsers) throws AtlanException
      Find the most-viewed assets in Atlan.
      Parameters:
      client - connectivity to the Atlan tenant on which to run the search
      maxAssets - maximum number of assets to consider
      byDifferentUsers - when true, will consider assets viewed by more users as more important than total view count, otherwise will consider total view count most important
      excludeUsers - list of usernames to exclude from the results
      Returns:
      the list of assets that are most-viewed, in descending order (most-viewed first)
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • toRequest

      public SearchLogRequest toRequest()
      Translate the Atlan search log into an Atlan search log request.
      Returns:
      an Atlan search log request that encapsulates the requested criteria
    • count

      public long count() throws AtlanException
      Return the total number of search log entries that will match the supplied criteria, using the most minimal query possible (retrieves minimal data).
      Returns:
      the count of search log entries that will match the supplied criteria
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • stream

      public Stream<SearchLogEntry> stream() throws AtlanException
      Run the search to retrieve search log entries that match the supplied criteria.
      Returns:
      a stream of search log entries that match the specified criteria, lazily-fetched
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • stream

      public Stream<SearchLogEntry> stream(boolean parallel) throws AtlanException
      Run the search to retrieve search log entries that match the supplied criteria.
      Parameters:
      parallel - if true, returns a parallel stream
      Returns:
      a stream of search log entries that match the specified criteria, lazily-fetched
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • parallelStream

      public Stream<SearchLogEntry> parallelStream() throws AtlanException
      Run the search to retrieve search log entries that match the supplied criteria, using a parallel stream (multiple pages are retrieved in parallel for improved throughput).
      Returns:
      a stream of search log entries that match the specified criteria, lazily-fetched
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • bulkStream

      public Stream<SearchLogEntry> bulkStream() throws AtlanException
      Run the search to retrieve search log entries that match the supplied criteria, using a stream specifically meant for streaming large numbers of results (10,000 or more). Note: this will apply its own sorting algorithm, so any sort order you have specified may be ignored.
      Returns:
      a stream of search log entries that match the specified criteria, lazily-fetched
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • _dsl

      protected IndexSearchDSL.IndexSearchDSLBuilder<?,?> _dsl()
      Translate the Atlan search log search into an Atlan search DSL builder.
      Returns:
      an Atlan search DSL builder that encapsulates the search log search
    • _requestBuilder

      protected SearchLogRequest.SearchLogRequestBuilder<?,?> _requestBuilder()
      Translate the Atlan search log search into an Atlan search log request builder.
      Returns:
      an Atlan search log request builder that encapsulates the search
    • _internal

      public static SearchLog.SearchLogBuilder<?,?> _internal()