Package org.graylog2.indexer.searches
Class Searches
java.lang.Object
org.graylog2.indexer.searches.Searches
-
Constructor Summary
ConstructorDescriptionSearches
(IndexRangeService indexRangeService, com.codahale.metrics.MetricRegistry metricRegistry, StreamService streamService, Indices indices, IndexSetRegistry indexSetRegistry, SearchesAdapter searchesAdapter) -
Method Summary
Modifier and TypeMethodDescriptionextractStreamId
(String filter) Extracts the last stream id from the filter string passed as part of the elasticsearch query.fieldStats
(String field, String query, String filter, TimeRange range, boolean includeCardinality, boolean includeStats, boolean includeCount) fieldStats
(String field, String query, TimeRange range) scroll
(String query, TimeRange range, int limit, int offset, List<String> fields, String filter, int batchSize) Deprecated.search
(SearchesConfig config)
-
Constructor Details
-
Searches
@Inject public Searches(IndexRangeService indexRangeService, com.codahale.metrics.MetricRegistry metricRegistry, StreamService streamService, Indices indices, IndexSetRegistry indexSetRegistry, SearchesAdapter searchesAdapter)
-
-
Method Details
-
count
-
count
-
scroll
@Deprecated public ScrollResult scroll(String query, TimeRange range, int limit, int offset, List<String> fields, String filter, int batchSize) Deprecated. -
search
-
search
public SearchResult search(String query, String filter, TimeRange range, int limit, int offset, Sorting sorting) -
search
-
fieldStats
-
fieldStats
public FieldStatsResult fieldStats(String field, String query, String filter, TimeRange range, boolean includeCardinality, boolean includeStats, boolean includeCount) -
extractStreamId
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
-