However, I would like to use something other than incrementing
counter, because in my project I have to index new document within
listener event, so I want to avoid using global variables. Is there
any way to create new id on the fly using Java classes from ES
library?
Just provide whatever id you want, if you don't provide one, then one will be generated for you.
On Wednesday, March 9, 2011 at 10:19 AM, eugene wrote:
Hi everyone,
I went over the Java code examples, and I saw that whenver
IndexResponse is created, the id value is always code-generated, i.e.
However, I would like to use something other than incrementing
counter, because in my project I have to index new document within
listener event, so I want to avoid using global variables. Is there
any way to create new id on the fly using Java classes from ES
library?
Thanks Shay, that worked! From your experience, is it better to put
muliple documents under one index, or create more indices for each
document (which I doubt is a good idea because you may run out of
space), or different types per single index for each new json entry?
However, I would like to use something other than incrementing
counter, because in my project I have to index new document within
listener event, so I want to avoid using global variables. Is there
any way to create new id on the fly using Java classes from ES
library?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.