Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Define the _id field as id for an object #7

Closed
@agindre

Description

@agindre

Actually, I have to implement my own json parser to handle the elasticsearch json because I want to use the _id as value for my object's variable id. For me, it's the easy way to have an auto-increment id from elasticsearch that I can use as identifier for my doc.

The other way is :

  1. create the document form java
  2. get the latest id by sending a request to ES server
  3. insert the id into the document
  4. index the doc into ES

Here a good example to do so by using the _version as auto-increment : http://blogs.perl.org/users/clinton_gormley/2011/10/elasticsearchsequence---a-blazing-fast-ticket-server.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions