class LogStash::Search::Base
Public Instance Methods
count(query)
click to toggle source
Count the results given by a query.
# File lib/logstash/search/base.rb, line 35 def count(query) raise "The class #{self.class.name} must implement the 'count' method." end
histogram(query, field, interval=nil)
click to toggle source
Yields a histogram by field of a query.
This method is async. You should expect a block to be passed and therefore should yield a result, not return one.
Implementations should yield a LogStash::Search::FacetResult::Histogram
# File lib/logstash/search/base.rb, line 24 def histogram(query, field, interval=nil) raise "The class #{self.class.name} must implement the 'histogram' method." end
popular_terms(query, fields, count=10)
click to toggle source
Returns a list of popular terms from a query TODO(sissel): Implement
# File lib/logstash/search/base.rb, line 30 def popular_terms(query, fields, count=10) raise "The class #{self.class.name} must implement the 'popular_terms' method." end
search(query)
click to toggle source
Do a search.
This method is async. You can expect a block and therefore should yield a result, not return one.
Implementations should yield a LogStash::Search::Result
LogStash::Search::Result#events
must be an array of LogStash::Event
# File lib/logstash/search/base.rb, line 14 def search(query) raise "The class #{self.class.name} must implement the 'search' method." end