Class Searches

java.lang.Object
org.graylog2.indexer.searches.Searches

@Singleton public class Searches extends Object
  • Constructor Details

  • Method Details

    • count

      public CountResult count(String query, TimeRange range)
    • count

      public CountResult count(String query, TimeRange range, String filter)
    • scroll

      @Deprecated public ChunkedResult scroll(String query, TimeRange range, int limit, int offset, List<String> fields, String filter, int batchSize)
      Deprecated.
    • search

      public SearchResult search(String query, TimeRange range, int limit, int offset, Sorting sorting)
    • search

      public SearchResult search(String query, String filter, TimeRange range, int limit, int offset, Sorting sorting)
    • search

      public SearchResult search(SearchesConfig config)
    • fieldStats

      public FieldStatsResult fieldStats(String field, String query, TimeRange range)
    • fieldStats

      public FieldStatsResult fieldStats(String field, String query, String filter, TimeRange range, boolean includeCardinality, boolean includeStats, boolean includeCount)
    • extractStreamId

      public static Optional<String> extractStreamId(String filter)
      Extracts the last stream id from the filter string passed as part of the elasticsearch query. This is used later to pass to possibly existing message decorators for stream-specific configurations. The assumption is that usually (when listing/searching messages for a stream) only a single stream filter is passed. When this is not the case, only the last stream id will be taked into account. This is currently a workaround. A better solution would be to pass the stream id which is supposed to be the scope for a search query as a separate parameter.
      Parameters:
      filter - the filter string like "streams:xxxyyyzzz"
      Returns:
      the optional stream id