Hi,
I've been facing an issue regarding runtime fields scoring using decay functions. Let me share a snippet of my code for the refrence:
Runtime Field
"runtime_mappings": {
"price": {
"type": "double",
"script": {
"source":''
}
}
}
And this is a decay function for score calculation:
"functions": [
{
"linear": {
"price": {
"origin": "150.00",
"scale": 10,
"offset": "50.00",
"decay": 0.75
}
}
}
],
Now the thing is, when I search price:
"must": [
{
"range": {
"price": {
"gte": "100.00",
"lte": "200.00"
}
}
}
]
It gives me an error that
UnhandledPromiseRejectionWarning: Error: [parsing_exception] field [price] is of type [org.elasticsearch.index.mapper.DoubleScriptFieldType@74647e76], but only numeric types are supported., with { line=1 & col=1 }
Can anyone help me in this. Because I find that there is an incompatibility of datatypes. How can we handle this issue ?
Thanks in Advance.