Skip to content

Instantly share code, notes, and snippets.

@marick
Last active August 29, 2015 13:57
Show Gist options
  • Save marick/9475532 to your computer and use it in GitHub Desktop.
Save marick/9475532 to your computer and use it in GitHub Desktop.
(ns getset.services.derp)
(require '[clojurewerkz.elastisch.rest :as esr]
'[clojurewerkz.elastisch.rest.index :as index]
'[clojurewerkz.elastisch.rest.document :as document])
(esr/connect! "http://localhost:9200")
(when (index/exists? "myapp2_development") (prn (index/delete "myapp2_development")))
(prn 1 (index/create "myapp2_development" :mappings {"person" {:properties {:age {:type "integer"}}}}))
(prn 2 (document/create "myapp2_development" "person" {:age 55}))
(prn 3 (document/search "myapp2_development" "person" :query {"term" {"age" 55}}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment