New in Elasticsearch

Hello I'm new using Elasticsearch and I have some questions:

I want to save data into Elasticsearch. Can I do this without a mapping? If this is posible something like this is correct?

curl -XPOST 'http://localhost:9200/my_template/_bulk' -d '{"field1":"field1","field1":"string","field2":integer,"field3":"item","field4":"integer","properties":{"field5":"integer","field6":"array","field7":"integer"},"field8":{"date":"2015-12-30 13:30:05.000000","timezone_type":3,"timezone":"Europe/Zurich"}}'

If this is not possible. This is correct?

{"settings" : {"index" : {"number_of_shards" : 3, "number_of_replicas" : 2}}, "template": "My_template","type": "object", "mappings": {"properties" : {"id": {"type": "string"},"field1" : {"type": "string"},"field2" : {"type": "string"},"field3" : {"type": "string"},"field4" : {"type": "string"},"field5" : {"type": "string"},"field6" : {"type": "object","properties": {"field6.1": {"type": "string"},"field6.2": {"type": "string","items": {"type": "string"}},"field7": {"type": "int"}},"field8" : {"type": "date", "format" : "basic_date_time_no_millis"}}}}}

This get me an error with type and date format.

When I save data into Elasticsearch. Is normal that I lose 1G on my disk? I can save a mapping and I lose 1G on my disk.


Yeah, it uses this - Dynamic Mapping | Elasticsearch Guide [2.3] | Elastic

Thanks for response.
That works, but if I have:

{"field1":"field1","field1":"string","field2":integer,"field3":"item","field4":"integer","properties":{"field5":"integer","field6":"array","field7":"integer"},"field8":{"date":"2015-12-30 13:30:05.000000","timezone_type":3,"timezone":"Europe/Zurich"}}

And I want get a search about field3

curl -XGET 'http://localhost:9200/data/purchases/_sourse?pretty=true' -d '{"field3" : "11"}'

I get this

"_index" : "data",
"_type" : "purchases",
"_id" : "_sourse",
"found" : false

Also I try this

curl -XGET 'http://localhost:9200/data/purchases/_search?pretty=true' -d '"query" : { "query_string" : {"field3" : "11"}}'

That is wrong?


It can't find a document that has that value.