Skip to content

Commit

Permalink
Do not destructure individual keys where we don't use them
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Feb 7, 2012
1 parent 5d3bdd1 commit d19f244
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/elastisch/core.clj
Expand Up @@ -5,29 +5,29 @@
(:use [clojure.set]))

(defn put
[index type id document & {:keys [version op_type routing parent timestamp ttl prelocate timeout refresh replication consistency] :as all}]
[index type id document & {:as all}]
(rest/put
(rest/record index type id all)
:body document))

(defn create
"Creates document, autogenerating ID"
[index type document & {:keys [version op_type routing parent timestamp ttl prelocate timeout refresh replication consistency] :as all}]
[index type document & {:as all}]
(rest/post
(rest/index-type index type all)
:body document))

(defn get
"Gets Document by Id or returns nil if document is not found."
[index type id & {:keys [realtime fields routing preference refresh] :as all}]
[index type id & {:as all}]
(let [result (rest/get
(rest/record index type id all))]
(if (utils/not-found? result)
nil
result)))

(defn delete
[index type id & {:keys [version routing parent replication consistency refresh] :as all}]
[index type id & {:as all}]
(rest/delete
(rest/record index type id all)))

Expand Down Expand Up @@ -55,12 +55,10 @@

;; (defn uri-search
;; [index type & { :keys [q df analyzer default-operator explain fields sort track-scores timeout from size search-type lowercase-expanded-terms analyze-wildcard]}])

;;

(defn search
[index-name-or-names type-name-or-names & { :keys [query sort facets filter highlight size from fields min-score version explain script-fields index-boost
;; Query string attributes
search-type scroll size] :as options }]
[index-name-or-names type-name-or-names & { :as options }]
(let [query-string-attributes (select-keys options [:search-type :scroll :size])
body-attributes (difference options query-string-attributes)]
(rest/post
Expand Down

0 comments on commit d19f244

Please sign in to comment.