Elasticsearch-py: Need an ID to create a document

Created on 10 Jan 2017  路  3Comments  路  Source: elastic/elasticsearch-py

in version 5 it appears that a document ID must be specified to create a document. If one is not specified the following error appears:

TypeError: create() missing 1 required positional argument: 'id'

This is nonsensical. If I do not specify an ID elasticsearch should create one for me.

Most helpful comment

create API is nonsensical without the ID, if you don't have an ID you don't need the create API as you can just call index API.

create API exists only to force creation (and fail if document already exists).

Duplicate of #474

All 3 comments

create API is nonsensical without the ID, if you don't have an ID you don't need the create API as you can just call index API.

create API exists only to force creation (and fail if document already exists).

Duplicate of #474

Fair enough. Thanks

so use index instead?

BTW create can assign a customized id :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tirkarthi picture tirkarthi  路  6Comments

thekofimensah picture thekofimensah  路  3Comments

pandaadb picture pandaadb  路  6Comments

jaisharma639 picture jaisharma639  路  6Comments

juancar1979 picture juancar1979  路  4Comments