    "Grabs a system by an id"
    [id]
   (doc/get index "system" id))
+
+(defn query 
+   "basic query string" 
+   [query]
+  (doc/search index "system" :query query :fields ["owner" "env"])
+  )

  (:refer-clojure :exclude [get])
  (:require 
    [clojurewerkz.elastisch.native :as es]
    [clojurewerkz.elastisch.native.index :as idx]
    [clojurewerkz.elastisch.native.document :as doc])
  )

(def ^:const index "celestial-systems")


  (when-not (idx/exists? index)
    (idx/create index :mappings system-types)))

(defn put
   "Add/Update a system into ES"
   [id system]
  (doc/put index "system" id system))

