I have a query with a bunch of "filter": []
Then a bunch of scoring functions:
"must": [ { "function_score": { "functions": [ ... ] } } ]
I am trying to have documents with a specific keyword to rank higher than if they dont have it.
I tried to add this into my functions array:
{
"filter": {
"match": {
"[MY FIELD]": "[MY KEYWORD]"
}
},
"weight": 1
}
But I think it is doing the opposite, it is adding a coefficient below 1 to the one which match and therefor making the document with MY KEYWORD to rank lower.
I tried to search for a not method to match for all the one without MY KEYWORD but I cannot find anything in the context of functions. I found match_not but it doesnt work there.
My goal is if you have 2 exact same documents, one with MY KEYWORD and one without, I want to one with to have a higher score.
Thank you.