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

"Go by most popular queries" is empty when templates are unranked #805

Closed
ValWood opened this issue May 31, 2022 · 2 comments
Closed

"Go by most popular queries" is empty when templates are unranked #805

ValWood opened this issue May 31, 2022 · 2 comments
Labels
bug Home Related to the home/frontpage Templates
Milestone

Comments

@ValWood
Copy link

ValWood commented May 31, 2022

How does this field get configured? Or is it automatically populated based on the actual most popular queries

@ValWood ValWood changed the title Question: How to populate "GO by most popular queries" Question: How to populate "Go by most popular queries" May 31, 2022
@heralden
Copy link
Member

heralden commented Jun 1, 2022

It is automatically populated: The categories are the top 6 with the most numerous templates that are part of the top 50 ranked templates. The templates to each category are part of the same top 50 ranked templates, although reduced to the top 10 for each category.

Unfortunately the hits from BG aren't counted yet (intermine/intermine#2278). I see this leads to it being blank on Pombemine, which isn't good. Hope it's alright I'll repurpose this issue to fix that - it should still show templates even if they aren't ranked.

@heralden heralden changed the title Question: How to populate "Go by most popular queries" "Go by most popular queries" is empty when templates are unranked Jun 1, 2022
@heralden heralden added this to the Unreleased milestone Jun 1, 2022
@heralden heralden added bug Templates Home Related to the home/frontpage labels Jun 1, 2022
@heralden
Copy link
Member

heralden commented Jun 1, 2022

This is probably due to the templates having "rank": "unranked" instead of a number in the JSON.

(let [top-50-templates (take-while #(<= (-> % val :rank parse-template-rank) 50)

Should be an easy fix by adding a check for whether all templates are unranked and if so, just grab the first (up to) 50 templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Home Related to the home/frontpage Templates
Projects
None yet
Development

No branches or pull requests

2 participants