Now I'd like to update documents with parent-child relationships. When I use script to update, prompt me "field"[_ routing] is a metadata field and cannot be added inside a document. Use the index API request parameters.".
.But when I use a pipeline casually,like
PUT _ingest/pipeline/test
{
"processors": [
{
"set": {
"field": "city",
"value": "beiji"
}
}
]
}
POST my_index/_update_by_query?pipeline=test
{
"script": {
"source": """
ctx._source._routing = 1;
"""
},
"query": {
"match": {
"text": "aaa"
}
}
}
So I successfully updated routing,I want to know why