5

Am using Elasticsearch 1.4. My requirement is I will have data every hour and that needs to be uploaded. So the approach that I have taken is to create an index - "demo" and upload the data. So, the first hour data gets inserted. Now, my question is how to append the subsequent hours data into this index.

PUT /demo/userdetails/1
{
    "user" : "kimchy",
    "message" : "trying out Elastic Search"
}

Now I am trying to add another document

{"user": "swarna","message":"hi"}
1
  • Hi are you get data from which Source? Commented Mar 27, 2015 at 11:16

1 Answer 1

7

You simply need to PUT the additional documents. In your example above you did

PUT /demo/userdetails/1 { "user" : "kimchy", "message" : "trying out Elastic Search" }

Now you would do this:

PUT /demo/userdetails/2 {"user": "swarna","message":"hi"}

In you command there demo is the index, userdetails is the type, and the number is the document id. If you omit the document id ES will make one up for you.

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.