I have a list property with composite index and mixed index built.
// build composite and mixed indexes
JanusGraphTransaction tx = graph.newTransaction();
JanusGraphVertex vertex1 = tx.addVertex(T.label, "Person");
vertex1.property("Person_emailList", "\"aa@qq.com\t");
long id = vertex1.longId();
System.out.println("id="+id);
tx.commit();
tx = graph.newTransaction();
Vertex vertex2 = tx.getVertex(id);
// str ends with a tab character
String str = "\"bb@qq.com ";
vertex2.property("Person_emailList", str);
tx.commit();
java.io.IOException: Failure(s) in Elasicsearch bulk request: {type=illegal_argument_exception, reason=failed to execute script, caused_by={type=script_exception, reason=compile error, script_stack=[... ["Person_emailList"].add("\"bb@qq.com\t");, ^---- HERE], script=if(ctx._source["Person_emailList"] == null){ctx._source["Person_emailList"] = [];}ctx._source["Person_emailList"].add("\"bb@qq.com\t");, lang=painless, caused_by={type=illegal_argument_exception, reason=unexpected character ["\"bb@qq.com\t]. The only valid escape sequences in strings starting with ["] are [\\] and [\"]., caused_by={type=lexer_no_viable_alt_exception, reason=null}}}}
at org.janusgraph.diskstorage.es.rest.RestElasticSearchClient.bulkRequest(RestElasticSearchClient.java:274)
in getAdditionScript method, my update script is like this:
I have a list property with composite index and mixed index built.
in getAdditionScript method, my update script is like this:
in bulkRequest method, after
outputStream.write(mapWriter.writeValueAsBytes(request.getSource()));
the script goes like this:I thought it was an ES bug. But they say it's not. painless cannot parse escaped characters correctly
I cannot step into outputStream.write method, so I changed getAdditionScript method like this and then I got the script I wanted.: