1

I have used

curl -XPOST "http://localhost:9200/<my_index_name>" -d @<absolute_path_to_my_json_file>

Then when I tried to get the data using

curl -XGET "http://localhost:9200/<my_index_name>"

its giving me data only for first line of my json file. (including other stuff also - settings, mappings,alias etc). But why is it not able to load the entire json file ? BTW, I am using ES 2.4.0. If I have to use bulk, what is the syntax ?

3
  • 1
    Instead of -d you need to use --data-binary when sending a file via curl. Commented Sep 21, 2016 at 10:51
  • Tried using --data-binary. It gives {"acknowledged":true}. But when I use the get command to see the data. It gives empty in second hits. Used this command - curl -XGET "localhost:9200/<my_index_name>/_search?pretty=true" Commented Sep 22, 2016 at 5:36
  • I wanted to add one more thing here. I was able to see data when I was using ES 1.4.4. Now I changed to 2.4.0. Its not showing me data with .../_search. Commented Sep 22, 2016 at 5:38

2 Answers 2

1

Try using these curl -XPUT "http://localhost:9200/<my_index_name>" -d @<absolute_path_to_my_json_file>

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

Comments

0

GET index does not search actually.

You have also to run something like GET index/_search.

1 Comment

I wanted to add one more thing here. I was able to see data when I was using ES 1.4.4. Now I changed to 2.4.0. Its not showing me data with .../_search.

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.