elastisch icon indicating copy to clipboard operation
elastisch copied to clipboard

Unable to create index

Open jollyblondgiant opened this issue 2 years ago • 0 comments

using elasticsearch version: 8.1.2 (built from docker image) using elastisch version: 3.0.1

here's my core.clj:

(ns try-elastisch.core
 (:require [clojurewerkz.elastisch.rest :refer [connect]]
                 [clojurewerkz.elastisch.rest.index :as index]
                 [clojurewerkz.elastisch.rest.document :as doc])
 (:gen-class))

(defn -main 
  [& _]
  (let [port 9200
          host "127.0.0.1"
          cluster-name "docker-cluster"
          mappings {:thing {:properties {:foo {:type "text" :store "yes"}}}}
          conn (connect (str host ":" port) {:basic-auth ["elastic" {{pw-from-docker-output}}]})
          local-index (index/create conn "local-index" {:mappings mappings})]
      (doc/create conn "local-index" "thing" {:foo "bar"}))

starting the project with lein do clean, run results in the following error: "{\"error\":\"Incorrect HTTP method for uri [/local-index] and method [POST], allowed: [GET, HEAD, PUT, DELETE]\",\"status\":405}" clojurewerkz.elastisch.rest/connect results in a call to clojurewerkz.elastisch.rest/put, which in turn calls clj-http/put. Where is this error related to POST coming from?

jollyblondgiant avatar Apr 04 '22 19:04 jollyblondgiant