ES 6.2.3
My index contains docs like this:
{
str1: "some string",
str2: "other string"
}
I'm using a custom plugin that implements a ScriptEngine based on these examples:
Advanced scripts using script engines
ExplainableScript integration test
I can pass in parameters, compare them to doc values, and return a score.
So far, so good!
Here's the hard part. I need to return more than just the double score. I need to get this information back for each document matched:
{
fuzzyQuality_str1: "high", // or an int or double, doesn't matter
fuzzyQuality_str2: "low", // or an int or double, doesn't matter
composite_score: 42.0
}
I can do the fuzzy computations, and use them to calculate a composite score, and even return that score. I just can't figure out how to also get the "fuzzy quality" values back too.
Is there a way to modify the "hit" somehow?
Or can I return a vector of values?
Some other way?