Identity/Autonumber ID's

Is there a way of using identity/autonumber ids in ES similar to a
traditional relational database?
I have an index called post_index with "post" documents and I want to
assign unique numeric ids to them (1, 2, 3..). Is there an easy way of
doing this or should I manage the generation of the ids somewhere else?

When you send a document without ID, ES will give you one.
It's not a counter but a hashcode.

David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 5 juin 2012 à 01:48, Daniel Duarte Figueiredo danielduartefigueiredo@gmail.com a écrit :

Is there a way of using identity/autonumber ids in ES similar to a traditional relational database?
I have an index called post_index with "post" documents and I want to assign unique numeric ids to them (1, 2, 3..). Is there an easy way of doing this or should I manage the generation of the ids somewhere else?

If you really need an auto increment style number instead of the auto
generated ids, you can use the _version technique describe
here http://blogs.perl.org/users/clinton_gormley/2011/10/elasticsearchsequence---a-blazing-fast-ticket-server.html

Thanks you both. I had noticed the generated hashcode, but I really need an
auto increment style number, so I will give it a try. Very helpful link.

2012/6/5 Andy Wick andywick@gmail.com

If you really need an auto increment style number instead of the auto
generated ids, you can use the _version technique describe here
ElasticSearch::Sequence - a blazing fast ticket server | Clinton Gormley [blogs.perl.org]

Hi Daniel, do you use the _version technique now? Is it working well for
you?

BTW: I created a node.js module https://github.com/analog-nico/es-sequence for
it.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7f3186a1-0ac9-4980-8e15-75fd329ee312%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hi, i tried ur module, it is useful & nice. But why sequence version
increments by 100? is it blank updating 100 times?

On Sunday, March 30, 2014 at 6:36:59 PM UTC+8, Nicolai Kamenzky wrote:

Hi Daniel, do you use the _version technique now? Is it working well for
you?

BTW: I created a node.js module
https://github.com/analog-nico/es-sequence for it.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/beb97bb6-874b-4e08-abb3-04b4e6438119%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

For better performance the lib fetches 100 ids at a time and caches those.
This way elasticsearch is only queried every 100th get call.

Do you call init before every get call? This way the cache would be cleared
each time. init only needs to be called once on startup.

Am Freitag, 16. Januar 2015 14:09:22 UTC-5 schrieb Энхтөр Энхбат:

hi, i tried ur module, it is useful & nice. But why sequence version
increments by 100? is it blank updating 100 times?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c86dc437-3234-40e2-b5d3-68f46bc3545c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.