I'm using the python elasticsearch api to hit a elasticsearch on some data that has the following fields:
"id", "dateCreated", "title", "text_body"
The "dateCreated" is of the form '2021-09-01T23:09:54.79362+00:00'
I'm running a query against elasticsearch as follows:
body = {
"query": {
"multi_match": {
"query": <query>,
"fields": ['title^3', 'body']
}
},
"boosts": {
"dateCreated": {
"type": "proximity",
"function": "linear",
"center": "now",
"factor": 8
}
},
}
res = es.search(index=<index>, body=body)
When I run this I get the following error:
elasticsearch.exceptions.RequestError: RequestError(400, 'parsing_exception', 'Unknown key for a START_OBJECT in [boosts].')
I'm guessing it's having some issue with "dateCreated", but I'm not sure what. Any help would be much appreciated. Thanks!