Skip to content
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

positive_score_impact does not work with rank_features field #68619

Closed
KylePiira opened this issue Feb 6, 2021 · 4 comments · Fixed by #69994
Closed

positive_score_impact does not work with rank_features field #68619

KylePiira opened this issue Feb 6, 2021 · 4 comments · Fixed by #69994
Assignees
Labels
>enhancement :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch

Comments

@KylePiira
Copy link

So the rank_feature field has a positive_score_impact parameter to make it have a negative correlation with the score. However, this parameter does not work on rank_features fields.
When I try it, I get the following error: unknown parameter [positive_score_impact] on mapper [rank_features] of type [rank_features]

@KylePiira KylePiira added >enhancement needs:triage Requires assignment of a team area label labels Feb 6, 2021
@jtibshirani jtibshirani added :Search Relevance/Ranking Scoring, rescoring, rank evaluation. and removed needs:triage Requires assignment of a team area label labels Feb 19, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Feb 19, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@mayya-sharipova
Copy link
Contributor

mayya-sharipova commented Mar 4, 2021

@KylePiira Thank you for submitting the issue. We can add positive_score_impact parameter to rank_features type as well, but if used it will be applied to all sub-features of this rank_features.

Will this address your use case?
I am also interested to learn more about your use case of using positive_score_impact=false with rank_features.

@KylePiira
Copy link
Author

Hi @mayya-sharipova, yes that would address my use case. I'm using rank_features where the key is a user ID and the value is a rating that a user has given to a particular document. When a user performs a search I want to boost documents that they have rated highly in the results (currently possible with rank_feature). However, users can also give negative ratings to documents and I would like to negatively boost those in the results.
So for a given document you might have:

{
	"title": "...",
	"body": "...",
	"positive_ratings": {
		"1": 5,
		"3": 2,
		"7": 3
	},
	"negative_ratings": {
		"6": 4,
		"2": 8
	}
}

Where positive_ratings is a rank_features with positive_score_impact=true and negative_ratings is a rank_features with positive_score_impact=false. Users 1, 3, and 7 have rated the document with scores of 5, 2, and 3 respectively. Users 6 and 2 have rated the document with scores of -4 and -8 respectively.

mayya-sharipova added a commit to mayya-sharipova/elasticsearch that referenced this issue Mar 4, 2021
rank_features field type misses positive_score_impact parameter
that rank_feature type has. This adds this parameter.

Closes elastic#68619
@mayya-sharipova
Copy link
Contributor

@KylePiira Thanks for sharing your use case; it was very useful. I was also thinking along the same lines.

mayya-sharipova added a commit that referenced this issue Mar 10, 2021
rank_features field type misses positive_score_impact parameter
that rank_feature type has. This adds this parameter.

Closes #68619
mayya-sharipova added a commit to mayya-sharipova/elasticsearch that referenced this issue Mar 10, 2021
rank_features field type misses positive_score_impact parameter
that rank_feature type has. This adds this parameter.

Backport for elastic#69994
Closes elastic#68619
mayya-sharipova added a commit that referenced this issue Mar 11, 2021
rank_features field type misses positive_score_impact parameter
that rank_feature type has. This adds this parameter.

Backport for #69994
Closes #68619
@javanna javanna added Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants