New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decay functions missing #8119
Comments
Hi @insulationman, thanks for requesting this feature. The decay functions will be implemented soon. They require some special handling to get generated correctly. |
@flobernd So I think it's better to at least give us options to create our own solution for that. Like I'm stuck trying to think in a workaround to use gauss function and even the Serializer function you put It's been a year #7428 You don't have time to create this function but you don't allow anyone else to at least try to create their own solution for that locally? This version 8 is incomplete and you have to give devs options to keep using it. |
From the other post:
An example of how to use the low level transport can be found in the migration guide. |
@flobernd thanks for the suggestion but intercepting the JSON or executing a complete JSON request? why use this library anyway? What I'm asking is just a possibility of creating my own FunctionScore so I don't need to rewrite the whole code just to add one additional feature |
Hi @jasielmacedo,
This library supports more than 450 endpoints and nearly 3000 types. I spent the past 6+ months continuing the good work of Martijn and Steve to get the code generator to a point where it finally supports 95%+ of the overall available Elasticsearch functionality. For me, these are at least 450 reasons to use the library, even if I would have to manually craft one JSON request myself - but that's of course just my personal opinion.
I think we misunderstood here. I'm strongly suggesting to use the library! You can use the regular client for everything besides the query that uses decay functions. For this particular case, you can fall-back to the low-level client (which still saves you from having to build the complete transport level layer yourself). The low level client is exposed by the regular client: I know that the above workaround is not perfect. At the same time, please note, that a lot has been added to the library in the last weeks and a lot of bugs have been fixed and usability problems have been addressed. I'm sorry, that the decay functions were not part of this yet, but they are on my todo list and I excpect then to be available within weeks.
I can give you another hacky alternative. Using reflection you could access the internal FunctionScore(string variantName, object variant) For For var gauss = """
{
"timestamp": {
"scale": "4w"
}
}
"""
var variant = new RawJsonString(gauss); The |
@flobernd Thanks. Yeah, I was wrong. It wasn't clear in the beginning but reading the code of the library I figured out. For the request I just updated the way I execute the query. I just created a delegate so I can intercept the json.
So My case the
|
Related to: elastic/elasticsearch-specification#2545 |
Is your feature request related to a problem? Please describe.
I want to use decay functions to boost recently created documents. This functionality seems to be missing from the client.
Describe the solution you'd like
I would like to be able to be able to add a decay function as described in the following code from the official docs:
I believe an api similar to the one for FieldValueFactor function would work well.
Link to Release Note
Describe alternatives you've considered
I have considered not using the official client, but I'm looking for better workarounds.
Additional context
I want to use this functionality to get recently created documents to score higher in searches.
The text was updated successfully, but these errors were encountered: