@@ -69,7 +69,7 @@ To create an index, use the +clojurewerkz.elastisch.rest.index/create+ function:
6969(esi/create "test1")
7070
7171;; Create an index with custom settings
72- (esi/create "test2" :settings {"number_of_shards" 1}))
72+ (esi/create "test2" :settings {"number_of_shards" 1})
7373----
7474
7575A full explanation of the available indexing settings is outside the
@@ -101,7 +101,7 @@ an index is created using the +:mapping+ option:
101101 :term_vector
102102 "with_positions_offsets"}}}})
103103
104- (esi/create "test3" :mappings mapping-types)))
104+ (esi/create "test3" :mappings mapping-types)
105105----
106106
107107===== Indexing documents
@@ -130,7 +130,7 @@ cause a document ID to be generated automatically:
130130
131131(esi/create "test4" :mappings mapping-types)
132132
133- (def doc {:username "happyjoe"
133+ (def doc1 {:username "happyjoe"
134134 :first-name "Joe"
135135 :last-name "Smith"
136136 :age 30
@@ -139,16 +139,16 @@ cause a document ID to be generated automatically:
139139 :biography "N/A"})
140140
141141
142- (esd/create "test4" "person" doc )
143- ;; => {:ok true, :_index people , :_type person,
142+ (esd/create "test4" "person" doc1 )
143+ ;; => {:created true, :_index "test4" , :_type " person" ,
144144;; :_id "2vr8sP-LTRWhSKOxyWOi_Q", :_version 1}
145145----
146146
147147+clojurewerkz.elastisch.rest.document/put+ will add a document to the index but expects a document ID to be provided:
148148
149149[source,clojure]
150150----
151- (esr /put "test4" "person" "happyjoe" doc )
151+ (esd /put "test4" "person" "happyjoe" doc1 )
152152----
153153
154154==== Discussion
0 commit comments