Through my experiment, it seems not possible to use string as primary key
in Elasticsearch.
If type String is used , then the _id will be something like this:
"_id":"[B@fe583b"
which uses the object address in jvm instead of the real value.
So, is there any way to generate a composite _id from two integer value?
The _id (metadata _id, that is) is a string value.
The value of the _id string is whatever you set it to (or else a long
string automatically generated by Elasticsearch when the document is
created). You have complete freedom to set it to any string value you wish.
The _id metadata is the closest thing ES has to a unique constraint, and I
use it quite effectively in this way.
Through my experiment, it seems not possible to use string as primary key
in Elasticsearch.
If type String is used , then the _id will be something like this:
"_id":"[B@fe583b"
which uses the object address in jvm instead of the real value.
So, is there any way to generate a composite _id from two integer value?
So, it seems to be mysql_jdbc_river's problem?
Here is my sql query:
"SELECT concat(fid,cmid) as _id .... FROM forum JOIN comment ..."
I set the concatenation of two integer fields to be the primary key and
causes the problem I described above..
Now I am dividing two tables into separate Types within an Index and using
their own integer id as the primary key.
On Monday, April 28, 2014 11:00:42 PM UTC+8, Adrien Grand wrote:
Can you share the code that you used to trigger this issue?
On Mon, Apr 28, 2014 at 4:39 PM, Yz <yingzh...@gmail.com <javascript:>>wrote:
Through my experiment, it seems not possible to use string as primary key
in Elasticsearch.
If type String is used , then the _id will be something like this:
"_id":"[B@fe583b"
which uses the object address in jvm instead of the real value.
So, is there any way to generate a composite _id from two integer value?
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.