Hello,
How do I get all the values in a numeric multi value field in Lucene Expressions. It return the minimum value by default. And I can ask for mean or min or max but not ALL values.
Basically I'm storing a vector as a multi value numeric field and want to do some calculations on the vector.
Example:
PUT employees
{
"settings":{
"number_of_shards": 1,
"number_of_replicas": 0
}
}
PUT employees/_mapping/map1'
{
"properties": {
"age": {
"type": "integer"
},
"name": {
"type": "keyword"
},
"skills": {
"type": "integer"
}
}
}
PUT employees/sales/1/
{
"age":521,
"name":"James1",
"skills":[5,1]
}
PUT employees/sales/2/
{
"age":522,
"name":"James1",
"skills":[4,10]
}
POST employees/_search
{
"query": {
"function_score": {
"boost_mode": "replace",
"functions": [
{
"script_score": {
"script": {
"inline": "doc['skills'].value",
"lang": "expression",
"params": {
}
}
}
}
],
"query": {
"match_all": {}
},
"score_mode": "sum"
}
}
}
Thanks,
Sep