Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee1cc48

Browse files
author
Ryan Neufeld
committed
Merge pull request clojure-cookbook#471 from dz-cies/patch2
Several fixes in 6.06
2 parents c4d4359 + cdcab82 commit ee1cc48

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

06_databases/6-06_indexing-with-elasticsearch.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

7575
A 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

Comments
 (0)