        (search [this query-ast]
          (index/search source query-ast))
        (update [this event]
-         (index/update source event))
+         (index/update source event)
+         (when registry
+           (ps/publish! registry "index" event)))
        (lookup [this host service]
          (index/lookup source host service))
 

(ns riemann.core
  "Binds together an index, servers, and streams."
  (:use [riemann.time :only [unix-time]]
        [riemann.common :only [localhost event]]
        clojure.tools.logging
        [riemann.instrumentation :only [Instrumented]])
  (:require riemann.streams


       clojure.lang.IFn
       (invoke [this event]
         (index/update this event)))))


(defn delete-from-index
