-
Notifications
You must be signed in to change notification settings - Fork 340
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
Add min_score support #2917
Comments
This should be displayed in the Menu "Elasticsuite > Relevance Configuration"
You can check this commit, it's nearly the same, when I introduced the "span boost" : 58f22d9 In this interface you'll have to add a way to get the min_score, something like getMinScore() : module-elasticsuite-core/Api/Search/Request/Container/RelevanceConfigurationInterface.php Then implement it : module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig.php You'll have a getMinScore() method that will return either false or an integer. Then implement the config factory : module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php If enabled, this returns the value. False otherwise.
You'll need to add a getMinScore() method to this interface : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-core/Search/RequestInterface.php And then, add the minScore as a property here, with also the appropriate getMinScore : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-core/Search/Request.php You'll have then to plug nearly here to inject the minScore: https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-core/Search/Request/Builder.php#L181 Probably something in the array like And then finally on the mapper, something similar to this :
Then to check, you'll have to enable/disable the min_score feature, change the value, and check that in the resulting Elasticsearch query, when you do a text search, you have a min_score with the proper value when it's enabled. When it's disabled or set to 0, you should have nothing. |
…ort-2.10-feature Feature #2917, add min_score support for matching documents
Done in latests releases |
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/search-search.html#search-api-min-score
This would allow to prevent having too much results. This can be useful for some customers.
The text was updated successfully, but these errors were encountered: