0

Below is how I index:

   conn = ES(['127.0.0.1:9200'],bulk_size=bulk_count)
   conn.index(tj,data['index'],data['type'],str(uuid4()),bulk=True)

I am using uuid but would rather have ES choose the index id for performance reasons. How do implement that in pyes so ES will auto create the index id?

Thanks

Tampa
  • 75,446
  • 119
  • 278
  • 425

1 Answers1

1

If you do not set the id elasticsearch automatically generates one for the document. It will be UUID-1 and it is much better for performance reasons.

Proof links: 1. https://www.elastic.co/guide/en/elasticsearch/guide/current/indexing-performance.html#_other 2. http://blog.mikemccandless.com/2014/05/choosing-fast-unique-identifier-uuid.html

So the best choose - is using Zero-padded sequential ids.

Srost
  • 129
  • 4