0

I have tried to add sample data set using postman as following way,

POST URL:  http://localhost:9200/allData

Add to postman body as json

{
    "index": "allData",
    "type": "all",
    "id": 1006,
    "body":  {

                    "id": 1006,
                    "url": "https://en.wikiversity.org/wiki/Principles_of_Management",
                    "title": "Principles of Management",
                    "author": "",
                    "rate": 0,
                    "ratedBy": 0,
                    "datePublished": "2018-01-01T00:00:00",
                    "publishedDate": "2018-01-01"   
    }
}

But it is given following error.

No handler found for uri [/] and method [POST]

Someone please help me to solve this issue. Thanks

1 Answer 1

2

There are certain issues with your request:

  • Elasticsearch index names cannot have uppercase so in your case it should be alldata not allData.
  • The format of the URL is wrong.

Your URL should be in the below format:

http://localhost:9200/{indexname}/{type}/{id}

which in your case must be:

http://localhost:9200/alldata/all/1006

So you should perform a POST request to the above url with the body as:

{
   "id": 1006,
   "url": "https://en.wikiversity.org/wiki/Principles_of_Management",
   "title": "Principles of Management",
   "author": "",
   "rate": 0,
   "ratedBy": 0,
   "datePublished": "2018-01-01T00:00:00",
   "publishedDate": "2018-01-01"   
}

Have a look at the Elasticsearch Reference Guide.

Hope it helps !

Sign up to request clarification or add additional context in comments.

Comments

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.