Class SearchLogRequest

java.lang.Object
com.atlan.model.core.AtlanObject
com.atlan.model.search.SearchLogRequest
All Implemented Interfaces:
Serializable

public class SearchLogRequest extends AtlanObject
Class from which to configure and run a search against Atlan's log of past searches. For a list of the attributes that can be searched, aggregated, sorted, etc see the static constants in SearchLogEntry.
See Also:
  • 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 SearchLogRequest.SearchLogRequestBuilder<?,?> builder(co.elastic.clients.elasticsearch._types.query_dsl.Query query)
      Build a search using the provided query and default options.
      Parameters:
      query - the query to use for the search
      Returns:
      the search request, with default options
    • builder

      public static SearchLogRequest.SearchLogRequestBuilder<?,?> builder(IndexSearchDSL dsl)
      Build a search using the provided DSL and default options.
      Parameters:
      dsl - the query details to use for the search
      Returns:
      the search request, with default options
    • views

      public static SearchLogRequest.SearchLogRequestBuilder<?,?> views()
      Start building a search log request for the views of assets.
      Returns:
      a request builder pre-configured with these criteria
    • views

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

      public static SearchLogRequest.SearchLogRequestBuilder<?,?> views(long from, long to)
      Start building a search log request for the views of assets.
      Parameters:
      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 SearchLogRequest.SearchLogRequestBuilder<?,?> views(long from, long to, List<String> excludeUsers)
      Start building a search log request for the views of assets.
      Parameters:
      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 SearchLogRequest.SearchLogRequestBuilder<?,?> searches()
      Start building a search log request for searches run against assets.
      Returns:
      a request builder pre-configured with these criteria
    • searches

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

      public static SearchLogRequest.SearchLogRequestBuilder<?,?> searches(long from, long to)
      Start building a search log request for searches run against assets.
      Parameters:
      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 SearchLogRequest.SearchLogRequestBuilder<?,?> searches(long from, long to, List<String> excludeUsers)
      Start building a search log request for searches run against assets.
      Parameters:
      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 SearchLogRequest.SearchLogRequestBuilder<?,?> viewsByGuid(String guid)
      Start building a search log request for the views of an asset, by its GUID.
      Parameters:
      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 SearchLogRequest.SearchLogRequestBuilder<?,?> viewsByGuid(String guid, List<String> excludeUsers)
      Start building a search log request for the views of an asset, by its GUID.
      Parameters:
      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(String guid, int maxUsers) throws AtlanException
      Find the most recent viewers of the asset in Atlan.
      Parameters:
      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(String guid, int maxUsers, List<String> excludeUsers) throws AtlanException
      Find the most recent viewers of the asset in Atlan.
      Parameters:
      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
    • 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(int maxAssets, boolean byDifferentUsers) throws AtlanException
      Find the most-viewed assets in Atlan.
      Parameters:
      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(int maxAssets, boolean byDifferentUsers, List<String> excludeUsers) throws AtlanException
      Find the most-viewed assets in Atlan.
      Parameters:
      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
    • 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
    • search

      public SearchLogResponse search() throws AtlanException
      Run the search.
      Returns:
      the matching assets
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • search

      public SearchLogResponse search(AtlanClient client) throws AtlanException
      Run the search.
      Parameters:
      client - connectivity to the Atlan tenant on which to run the search
      Returns:
      the matching assets
      Throws:
      AtlanException - on any issues interacting with the Atlan APIs
    • 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
    • count

      public long count(AtlanClient client) 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).
      Parameters:
      client - through which to run the request
      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 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(AtlanClient client) throws AtlanException
      Run the search to retrieve entries that match the supplied criteria.
      Parameters:
      client - through which to run the request
      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 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
    • stream

      public Stream<SearchLogEntry> stream(AtlanClient client, boolean parallel) throws AtlanException
      Run the search to retrieve entries that match the supplied criteria.
      Parameters:
      client - through which to run the request
      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
    • _internal

      public static SearchLogRequest.SearchLogRequestBuilder<?,?> _internal()
    • toBuilder

    • getDsl

      public IndexSearchDSL getDsl()
      Parameters for the search itself.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AtlanObject
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class AtlanObject
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AtlanObject
    • toString

      public String toString()
      Description copied from class: AtlanObject
      Overrides:
      toString in class AtlanObject