I want result which is based on 3 things CreationDate 65% , cars 20%, motorbike 15%
Data which is inserted in elasticsearch
{
"created": "2018-03-20T14:19:15Z",
"username": "adamcharles",
"stats": {
"cars": 20,
"motorbike ": 30
}
},
{
"created": "2017-03-20T14:19:15Z",
"username": "adamcharles",
"stats": {
"cars ": 100,
"motorbike ": 20
}
}
query of elastic search
GET showroom/_search
"query": {
"function_score":{
"functions": [
{
"gauss": {
"created": {
"origin": "now",
"scale": "10d",
"decay" :0.9
}
}
}
,{
"field_value_factor": {
"field": "stats.motorbike",
"factor": 15,
"modifier": "sqrt",
"missing": 1
}
},
{
"field_value_factor": {
"field": "stats.cars",
"factor": 20,
"modifier": "sqrt",
"missing": 1
}
} ],
"score_mode": "sum",
"boost_mode": "sum"
}
}
how can i apply factor on created date