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

per-site element search scores #13978

Closed

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Nov 30, 2023

Description

Calculate search scores per element and per site so that when an element is included in the results multiple times, it doesn’t get extra points.

Previously, the scoring array contained key-value pairs where the key was the elementId and the value was the calculated search score. This approach meant that if the search was performed across multiple sites, the element’s score was the sum of all its scores across all sites.

This PR adjusts the scoring array so that it’s still indexed by the elementId, but the value is an array where the key is the siteId and the value is the score for that element for that site.
A sum of scores for the element across all sites is still used for ordering, but each element’s score is unique per site.

Before:
Screenshot 2023-11-30 at 08 55 42

After:
Screenshot 2023-11-30 at 08 56 45

Before:
Screenshot 2023-11-30 at 08 56 13

After:
Screenshot 2023-11-30 at 08 56 57

Related issues

cms-1198

@i-just i-just requested a review from brandonkelly November 30, 2023 09:11
Copy link

linear bot commented Nov 30, 2023

CMS-1198 Calculate element search scores per-site

Element scores are currently calculated per-element, but not per-site. So elements that are included multiple times in the results will end up getting extra points. Calculating scores per-element and per-site will solve that.

brandonkelly added a commit that referenced this pull request Dec 20, 2023
@brandonkelly
Copy link
Member

Resolved via 5d8ac94. Scores are now indexed by both element ID and site ID, so we can sort the full list of scores as a single array.

@brandonkelly brandonkelly deleted the feature/cms-1198-calculate-element-search-scores-per-site branch December 20, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants