Hello,
I'm facing the following problem: accessing nested field within ingest processor fails with an error. Simple example on how to reproduce the problem:
- Create 'nest_test' index with mapping containing nested field:
curl -X PUT "localhost:9200/nest_test" -H 'Content-Type: application/json' -d'
{
"mappings":{
"resources":{
"properties":{
"nest":{
"type":"nested",
"dynamic":"strict",
"properties":{
"field_raw":{ "type":"keyword" },
"field_lower":{ "type":"keyword" }
}
}
}
}
}
}
'
- Create 'lowercase' pipeline:
curl -X PUT "localhost:9200/_ingest/pipeline/nested_lowercase" -H 'Content-Type: application/json' -d'
{
"description" : "failure reproducing",
"processors" : [
{
"lowercase" : {
"field": "nest.field_raw",
"target_field": "nest.field_lower"
}
}
]
}
'
- Index some data involving pipeline:
curl -X POST "localhost:9200/nest_test/1?pretty&refresh&pipeline=nested_lowercase" -H 'Content-Type: application/json' -d'
{"nest": [{"field_raw": "Test Me"}]}
'
The result is:
{
"error" : {
"root_cause" : [
{
"type" : "exception",
"reason" : "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: [field_raw] is not an integer, cannot be used as an index as part of path [nest.field_raw]",
"header" : {
"processor_type" : "lowercase"
}
}
],
"type" : "exception",
"reason" : "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: [field_raw] is not an integer, cannot be used as an index as part of path [nest.field_raw]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "java.lang.IllegalArgumentException: [field_raw] is not an integer, cannot be used as an index as part of path [nest.field_raw]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "[field_raw] is not an integer, cannot be used as an index as part of path [nest.field_raw]",
"caused_by" : {
"type" : "number_format_exception",
"reason" : "For input string: "field_raw""
}
}
},
"header" : {
"processor_type" : "lowercase"
}
},
"status" : 500
}
There similar topic with the same problem, but different processors, but no answers anywhere
https://discuss.elastic.co/t/nested-field-not-getting-processed-by-ingest-processor-plugin/96136
https://discuss.elastic.co/t/nested-documents-in-ingest-pipeline-processor/135305
https://github.com/elastic/elasticsearch/issues/22193
Is there a way to access and work with nested fields from processors?
Thanks in advance for your help,
Mike