<NME> facetresult.rb
<BEF> ADDFILE
<MSG> - partial implementation LogStash::Search::ElasticSearch#histogram

Example:

    EM.run {
      s = LogStash::Search::ElasticSearch.new();
      s.histogram("REJECTED", "@timestamp", 60 * 60 * 1000) { |r|
        p :results => r
      }
    }

    Output:
    {:results=>#<LogStash::Search::FacetResult:0x7f14c1380a18
    @facets={"histo1"=>{1296759600000=>1, 1295344800000=>1,
    ...

The FacetResult class is not fully baked.

<DFF> @@ -0,0 +1,25 @@
+
+require "logstash/namespace"
+require "logstash/logging"
+
+class LogStash::Search::FacetResult
+  # Array of LogStash::Event of results
+  attr_accessor :facets
+
+  # How long this query took, in seconds (or fractions of).
+  attr_accessor :duration
+
+  # Error message, if any.
+  attr_accessor :error_message
+
+  def initialize(settings={})
+    @facets = {} # TODO(sissel): need something better?
+    @duration = nil
+    @error_message = nil
+  end
+
+  def error?
+    return !@error_message.nil?
+  end
+end # class LogStash::Search::Result
+

- partial implementation LogStash::Search::ElasticSearch#histogram