I'm newbie with ES and i'm trying to set manually each document ID. I've
seen in the documentation the es.mapping.id propperty and I'm trying to
set it in the conf part of the driver class the same way i set the index
and type of documents:
conf.set("es.resource", "logs/{event}");
conf.set("es.mapping.id", "id");
In the Mapper class I put in the MapWritable object a new key value pair
for each map:
MapWritable doc = new MapWritable();
String id = node+"|"+timestamp; //node and timestamp are two String values
that I have.
doc.put(new Text("id"), new Text(id));
And as a result I can't write in ES and get exceptions with this message:
JsonParseException[Unexpected character ('"' (code 34))
If I comment the es.mapping.id line and allow ES to set the documents ID
everything works fine.
I had the same issue and it was solved using es-hadoop 2.0.1 instead 2.0.0.
Looks like a solved bug but I couldn't find anyone claiming it like an open
bug neither closed.
Regards
El martes, 3 de junio de 2014 15:52:21 UTC+2, Daniel Tardón escribió:
Hi all,
I'm newbie with ES and i'm trying to set manually each document ID. I've
seen in the documentation the es.mapping.id http://es.mapping.id
propperty and I'm trying to set it in the conf part of the driver class the
same way i set the index and type of documents:
conf.set("es.resource", "logs/{event}");
conf.set("es.mapping.id", "id");
In the Mapper class I put in the MapWritable object a new key value pair
for each map:
MapWritable doc = new MapWritable();
String id = node+"|"+timestamp; //node and timestamp are two String
values that I have.
doc.put(new Text("id"), new Text(id));
And as a result I can't write in ES and get exceptions with this message:
JsonParseException[Unexpected character ('"' (code 34))
If I comment the es.mapping.id line and allow ES to set the documents ID
everything works fine.
Glad to hear the issue has been fixed - not sure how I've missed this email before.
It was probably addressed in the way the parameters are handled [1]
In the future, when encountering an unexpected behaviour/bug please file an issue on github as well to make sure it's
not getting lost.
I had the same issue and it was solved using es-hadoop 2.0.1 instead 2.0.0. Looks like a solved bug but I couldn't find
anyone claiming it like an open bug neither closed.
Regards
El martes, 3 de junio de 2014 15:52:21 UTC+2, Daniel Tardón escribió:
Hi all,
I'm newbie with ES and i'm trying to set manually each document ID. I've seen in the documentation the
/es.mapping.id <http://es.mapping.id>/ propperty and I'm trying to set it in the conf part of the driver class the
same way i set the index and type of documents:
conf.set("es.resource", "logs/{event}");
conf.set("es.mapping.id <http://es.mapping.id>", "id");
In the Mapper class I put in the MapWritable object a new key value pair for each map:
MapWritable doc = new MapWritable();
String id = node+"|"+timestamp; //node and timestamp are two String values that I have.
doc.put(new Text("id"), new Text(id));
And as a result I can't write in ES and get exceptions with this message: JsonParseException[Unexpected character
('"' (code 34))
If I comment the es.mapping.id <http://es.mapping.id> line and allow ES to set the documents ID everything works fine.
What could I do?
Thanks in advance
I looked for issues in github related with specifying a document id in
MapReduce and the one [1] I found was closed without explanation and a link
to the online documentation.
So I wrote here because I thought it wasn't a bug. I thought it was a
misconfiguration in my code.
El martes, 3 de junio de 2014 15:52:21 UTC+2, Daniel Tardón escribió:
Hi all,
I'm newbie with ES and i'm trying to set manually each document ID. I've
seen in the documentation the es.mapping.id http://es.mapping.id
propperty and I'm trying to set it in the conf part of the driver class the
same way i set the index and type of documents:
conf.set("es.resource", "logs/{event}");
conf.set("es.mapping.id", "id");
In the Mapper class I put in the MapWritable object a new key value pair
for each map:
MapWritable doc = new MapWritable();
String id = node+"|"+timestamp; //node and timestamp are two String
values that I have.
doc.put(new Text("id"), new Text(id));
And as a result I can't write in ES and get exceptions with this message:
JsonParseException[Unexpected character ('"' (code 34))
If I comment the es.mapping.id line and allow ES to set the documents ID
everything works fine.
Actually the issue you refer to was not regarding a bug but rather a feature that the user was not aware of - hence the
closing comment pointing to the documentation.
In general, when in doubt, feel free to open an issue, even if it's a duplicate.
Glad to hear the problem has been sorted out.
Cheers!
On 9/2/14 12:06 PM, Daniel Tardón wrote:
Indeed updating to 2.0.1 solves the problem.
I looked for issues in github related with specifying a document id in MapReduce and the one [1] I found was closed
without explanation and a link to the online documentation.
So I wrote here because I thought it wasn't a bug. I thought it was a misconfiguration in my code.
El martes, 3 de junio de 2014 15:52:21 UTC+2, Daniel Tardón escribió:
Hi all,
I'm newbie with ES and i'm trying to set manually each document ID. I've seen in the documentation the
/es.mapping.id <http://es.mapping.id>/ propperty and I'm trying to set it in the conf part of the driver class the
same way i set the index and type of documents:
conf.set("es.resource", "logs/{event}");
conf.set("es.mapping.id <http://es.mapping.id>", "id");
In the Mapper class I put in the MapWritable object a new key value pair for each map:
MapWritable doc = new MapWritable();
String id = node+"|"+timestamp; //node and timestamp are two String values that I have.
doc.put(new Text("id"), new Text(id));
And as a result I can't write in ES and get exceptions with this message: JsonParseException[Unexpected character
('"' (code 34))
If I comment the es.mapping.id <http://es.mapping.id> line and allow ES to set the documents ID everything works fine.
What could I do?
Thanks in advance
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.