Skip to content

Unable to create index #272

@jollyblondgiant

Description

@jollyblondgiant

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions