Scoring on Child Documents


(kikster) #1

I have an interesting scoring problem:

I have a parent and child document with these mappings, using this
query:

I would like to score the parent documents based on the value in
"points" field in the child document. Is this possible? I know in
elasticsearch I can specify a field boost, but this is not exactly
what I need because I do not want to boost the whole document because
a field simply matches. Instead, I want to score the document based on
the value of a field inside a child document that a fuzzy like this
query matches.

I've tried to do this using a custom script where I pass in the query
string a user enters (in the gist it would be "Finance"), but the
problem is I cannot easily determine exactly which child document the
flt matched (since flt expands the set of query strings, and the
string that ultimately matches a child document may not be an exact
string or sub-string match).


(system) #2