1

i am new to ElasticSearch and i am following the guide on its official website. when i tried shorthand syntax given in the guide i.e.

PUT /megacorp/employee/1
{
    "first_name" : "John",
    "last_name" :  "Smith",
    "age" :        25,
    "about" :      "I love to go rock climbing",
    "interests": [ "sports", "music" ]
}

my terminal gives this error

PUT: command not found

please guide me what trick i am missing?

1 Answer 1

6

PUT is not a command, you need to use something like curl, try this:

curl -PUT http://localhost:9200/megacorp/employee/1 -d '
{
    "first_name" : "John",
    "last_name" :  "Smith",
    "age" :        25,
    "about" :      "I love to go rock climbing",
    "interests": [ "sports", "music" ]
}'
Sign up to request clarification or add additional context in comments.

1 Comment

it works fine but as mentioned in the official guide that we can use shorthand format like PUT /megacorp/employee/1 instead of the whole statement with curl, that does not work for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.