I have an Elasticsearch query that is giving me a response with standard _source data and some additional response that is inner_hits matching the nested document of the index. The response is something like below
{
"took" : 9,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 5,
"relation" : "eq"
},
"max_score" : 3.638414,
"hits" : [
{
"_index" : "family",
"_id" : "39684609",
"_score" : 3.638414,
"_source" : {...},
"inner_hits" : {
"representative.invention_title" : {
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 0.089231126,
"hits" : [
{
"_index" : "family",
"_id" : "39684609",
"_nested" : {
"field" : "representative.invention_title",
"offset" : 0
},
"_score" : 0.089231126,
"_source" : {
"title" : "Method for making a hammer"
}
}
]
}
}
}
}
]
}
}
I want to access that hits
inside inner_hits
. I can access source inside the spark dataframe, but not the inner_hits. I checked out the documentation they support metadata but I couldn't able to find a way to access inner_hits from metadata