Hello,
I trying create relation parent-child as in docs (https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html) but when i querying:
{
"query": {
"parent_id": {
"type": "answer",
"id": "1"
}
},
"aggs": {
"parents": {
"terms": {
"field": "my_join_field#question",
"size": 10
}
}
},
"script_fields": {
"parent": {
"script": {
"source": "doc['my_join_field#question']"
}
}
}
}
I got error:
{
"error" : {
"root_cause" : [
{
"type" : "script_exception",
"reason" : "compile error",
"script_stack" : [
"doc[my_join_field#question]",
" ^---- HERE"
],
"script" : "doc[my_join_field#question]",
"lang" : "painless"
}
],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 0,
"index" : "my_index",
"node" : "s4udXhJ0QJu6D5s7LhHnCA",
"reason" : {
"type" : "script_exception",
"reason" : "compile error",
"script_stack" : [
"doc[my_join_field#question]",
" ^---- HERE"
],
"script" : "doc[my_join_field#question]",
"lang" : "painless",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "unexpected character [#].",
"caused_by" : {
"type" : "lexer_no_viable_alt_exception",
"reason" : null
}
}
}
}
]
},
"status" : 500
}
What i'm doing wrong?