This would make the feature-value inputs available to be logged (as future training data) without having to re-evaluate each feature query as a script_field
.
E.g. Instead of having to do
GET /rando/_search
{
"query": {
"ltr": {
"model": {
"stored": "testmodel"
},
"features": [{
"script": {
"script": {
"lang": "expression",
"inline": "doc['lucky_number']"
}
}
}]
}
},
"script_fields": {
"1": {
"script" : {
"lang": "expression",
"inline" : "doc['lucky_number']"
}
}
},
"_source":true
}
{
"took": 10,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 0.5,
"hits": [
{
"_index": "rando",
"_type": "fortune",
"_id": "2",
"_score": 0.5,
"_source": {
"msg": "Let the deeds speak.",
"lucky_number": 2.2
},
"fields": {
"1": [
2.2
]
}
},
{
"_index": "rando",
"_type": "fortune",
"_id": "1",
"_score": 0.5,
"_source": {
"msg": "Be patient: in time, even an egg will walk.",
"lucky_number": 0.9
},
"fields": {
"1": [
0.9
]
}
},
{
"_index": "rando",
"_type": "fortune",
"_id": "3",
"_score": 0.5,
"_source": {
"msg": "Digital circuits are made from analog parts.",
"lucky_number": 3.3
},
"fields": {
"1": [
3.3
]
}
}
]
}
}
GET /rando/_search
{
"query": {
"ltr": {
"output_feature_values": true,
"model": {
"stored": "testmodel"
},
"features": [{
"script": {
"_name": "lucky",
"script": {
"lang": "expression",
"inline": "doc['lucky_number']"
}
}
}]
}
}
"_source":true
}
{
"took": 10,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 0.5,
"hits": [
{
"_index": "rando",
"_type": "fortune",
"_id": "2",
"_score": 0.5,
"_source": {
"msg": "Let the deeds speak.",
"lucky_number": 2.2
},
"feature_values": [{
"lucky": 2.2
}]
},
{
"_index": "rando",
"_type": "fortune",
"_id": "1",
"_score": 0.5,
"_source": {
"msg": "Be patient: in time, even an egg will walk.",
"lucky_number": 0.9
},
"feature_values": [{
"lucky": 0.9
}]
},
{
"_index": "rando",
"_type": "fortune",
"_id": "3",
"_score": 0.5,
"_source": {
"msg": "Digital circuits are made from analog parts.",
"lucky_number": 3.3
},
"feature_values": [{
"lucky": 3.3
}]
}
]
}
}