Class: LogStash::Search::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/search/base.rb

Direct Known Subclasses

ElasticSearch, Twitter

Instance Method Summary collapse

Instance Method Details

#count(query) ⇒ Object

Count the results given by a query.



35
36
37
# 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) ⇒ Object

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



24
25
26
# 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

Returns a list of popular terms from a query TODO(sissel): Implement



30
31
32
# 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) ⇒ Object

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



14
15
16
# File 'lib/logstash/search/base.rb', line 14

def search(query)
  raise "The class #{self.class.name} must implement the 'search' method."
end