Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create index #272

Open
jollyblondgiant opened this issue Apr 4, 2022 · 0 comments
Open

Unable to create index #272

jollyblondgiant opened this issue Apr 4, 2022 · 0 comments

Comments

@jollyblondgiant
Copy link

jollyblondgiant commented Apr 4, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant