Is it possible to auto increment documents as they are indexed?

Context:

  • I am using the bulk API to index several documents into an index

  • I would like to auto increment a field, 'y', present in the documents, which would tally the order in which documents are indexed. (I know i can do this using timestamp but am seeking alternatives)
    So the first document will have y=1 and in a future bulk import, the nth document will have y=n.

Is this possible?

(The reason why I am not using timestamp is because there is a chance that more than one document may have the same timestamp)

That is something you will need to handle and assign yourself before indexing the documents.

2 Likes

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