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
Function score: Add default
to field_value_factor
#10845
Conversation
@dakrone I can't get ElasticsearchF running locally and more. Its been a few months since I tried. I'm getting:
Is that something I'm doing? |
Thanks! That did it. |
I ran some local tests comparing this implementation which performs one auto-unboxing per document to a change that uses a primative instead. Ran across 1 million documents missing the field and both implementations were the same speed. I just wanted to test my instinct that auto-unboxing has the overhead of a method call and that looks true. |
@dakrone, is there a chance you can review today? I want to backport to https://github.com/wikimedia/search-extra soon and I would prefer to backport from a merged pull request. |
We have a similar parameter on |
@@ -193,6 +194,7 @@ There are a number of options for the `field_value_factor` function: | |||
|`modifier` |Modifier to apply to the field value, can be one of: `none`, `log`, | |||
`log1p`, `log2p`, `ln`, `ln1p`, `ln2p`, `square`, `sqrt`, or `reciprocal`. | |||
Defaults to `none`. | |||
|`default` |Default value used if the document doesn't have that field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should make explicit that the modifier
would still be applied in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
Sure. |
Yeah, +1 on |
Woops forgot one place. |
OK - I think I got it but I'm rerunning all the tests just in case. And because I like to hear my laptop's fan. |
This looks good to me too! |
OK. Going to go and backport now! |
Thanks! |
Do you want me to squash? |
@nik9000 sure, if you squash I'll merge :) |
field_value_factor now takes a default that is used if the document doesn't have a value for that field. It looks like: "field_value_factor": { "field": "popularity", "missing": 1 } Closes elastic#10841
8afb038
to
cb89a14
Compare
Squashed. |
default
to field_value_factor
field_value_factor now takes a default that is used if the document doesn't
have a value for that field. It looks like:
Closes #10841