in elasticsearch,I have a date field setup in my mapping like this:
"create_time" : {
"type" : "date",
"null_value" : "NULL"
},
i use pandas to process my data,it like this:
create_date
0 NULL
1 2019-09-23 14:32:32.217377
and in python i use bulk API,the method is:
def gendata(data, index):
INDEX = index
TYPE = "doc"
for record in data:
yield {
"_index": INDEX,
"_type": TYPE,
"_source": record,
}
bulk(client,gendata(data.to_dict(orient="records"),index="test"))
but i get BulkIndexError:('1 document(s) failed to index.', [{'index': {'_index': 'ics_asset', '_type': 'doc', '_id': '85vaXG0Be27aFy3eNkCZ', 'status': 400, 'error': {'type': 'illegal_argument_exception', 'reason': 'mapper [create_date] of different type, current_type [date], merged_type [text]'}, 'data': {'create_date': 'null'}}}]).
how can i use pandas bulk right "null" value with date format to elasticsearch.
thanks