Help: In Groovy script function: how can i use doc['child.field'] to get the value of child's field in Parent-child Relationship?


(Figer Sun) #1

in groovy script,
how can i use doc['child.field'] to get the value of child's field in Parent-child Relationship?


(Ryan Ernst) #2

Child docs cannot be accessed from a parent doc, as they are separate documents in Lucene. Depending on the type of script, you can look at the original document through _source, but note that this can be very slow as it means a disk load + json parsing.