@@ -69,7 +69,7 @@ To create an index, use the +clojurewerkz.elastisch.rest.index/create+ function:
69
69
(esi/create "test1")
70
70
71
71
;; Create an index with custom settings
72
- (esi/create "test2" :settings {"number_of_shards" 1}))
72
+ (esi/create "test2" :settings {"number_of_shards" 1})
73
73
----
74
74
75
75
A full explanation of the available indexing settings is outside the
@@ -101,7 +101,7 @@ an index is created using the +:mapping+ option:
101
101
:term_vector
102
102
"with_positions_offsets"}}}})
103
103
104
- (esi/create "test3" :mappings mapping-types)))
104
+ (esi/create "test3" :mappings mapping-types)
105
105
----
106
106
107
107
===== Indexing documents
@@ -130,7 +130,7 @@ cause a document ID to be generated automatically:
130
130
131
131
(esi/create "test4" :mappings mapping-types)
132
132
133
- (def doc {:username "happyjoe"
133
+ (def doc1 {:username "happyjoe"
134
134
:first-name "Joe"
135
135
:last-name "Smith"
136
136
:age 30
@@ -139,16 +139,16 @@ cause a document ID to be generated automatically:
139
139
:biography "N/A"})
140
140
141
141
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" ,
144
144
;; :_id "2vr8sP-LTRWhSKOxyWOi_Q", :_version 1}
145
145
----
146
146
147
147
+clojurewerkz.elastisch.rest.document/put+ will add a document to the index but expects a document ID to be provided:
148
148
149
149
[source,clojure]
150
150
----
151
- (esr /put "test4" "person" "happyjoe" doc )
151
+ (esd /put "test4" "person" "happyjoe" doc1 )
152
152
----
153
153
154
154
==== Discussion
0 commit comments