Bulk with _op_type:create throws exception id must be provided

elasticsearch.exceptions.RequestError: TransportError(400, u'action_request_validation_exception', u'Validation Failed: 1: an id must be provided if version type or value are set;')

Using elasticsearch.helpers for python script

I expect that the api should autogenerate _id, instead the _id is required to be filled manually.

doc={
'_id':''
'_op_type': 'create',
'_index': collection.lower() + "index",
'_type': collection.lower(),
'_source': nextrecord
}
yield(doc)
bulk(es, generate_doc())

Hope somebody can help with this...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.