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

feat(lxl-web): Add debug mode for relevancy scoring #1204

Merged
merged 8 commits into from
Jan 20, 2025

Conversation

olovy
Copy link
Contributor

@olovy olovy commented Jan 17, 2025

Add debug mode for relevancy scoring.

  • For each hit display total and per field score. And a percentage that relates the score to other hits on the same page.
    • (There is a backend bug that makes some field appear as e.g. "Synonym(hasTitle._str:hor hasTitle._str:")
  • Enable (sticky) with query param ?_debug=esScore, disable with ?_debug=false
    • this is a bit messy and buggy...
  • Click the score to show/hide detailed score calculation

bild

Tickets involved

LWS-296

@olovy olovy force-pushed the feature/LWS-296-debug-scoring branch from d392eb5 to 132d464 Compare January 20, 2025 08:59
@@ -16,8 +17,10 @@ export const load = async ({ params, url, locals, fetch }) => {
redirect(303, `/`); // redirect to home page if no search params are given
}

const debug = locals.userSettings?.debug.includes(DebugFlags.ES_SCORE) ? '&_debug=esScore' : '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what's causing the test to fail.
Try changing it to
const debug = locals.userSettings?.debug?.includes(DebugFlags.ES_SCORE) ? '&_debug=esScore' : '';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because: the test in question is changing the facet sorting, and thereby creating a settings cookie in userSettings. So it has locals.userSettings but not debug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! That was it. Missed it when changing it from a boolean to an array.

Copy link
Contributor

@johanbissemattsson johanbissemattsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@olovy olovy merged commit d7db0cd into develop Jan 20, 2025
2 checks passed
@olovy olovy deleted the feature/LWS-296-debug-scoring branch January 20, 2025 12:38
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.

3 participants