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 ?

Kalyanam Rajashree
  • 652
  • 2
  • 11
  • 23
  • 1
    Instead of `-d` you need to use `--data-binary` when sending a file via curl. – Val Sep 21 '16 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 "http://localhost:9200//_search?pretty=true" – Kalyanam Rajashree Sep 22 '16 at 05: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. – Kalyanam Rajashree Sep 22 '16 at 05:38

2 Answers2

1

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

ssdev
  • 11
  • 2
0

GET index does not search actually.

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

dadoonet
  • 14,109
  • 3
  • 42
  • 49
  • 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. – Kalyanam Rajashree Sep 22 '16 at 05:38