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

Show star ratings in search results #2405

Closed
cdrini opened this issue Sep 20, 2019 · 4 comments · Fixed by #2650
Closed

Show star ratings in search results #2405

cdrini opened this issue Sep 20, 2019 · 4 comments · Fixed by #2650
Assignees
Labels
Good First Issue Easy issue. Good for newcomers. [managed] hacktoberfest Issues appropriate for Hacktoberfest participants Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed]
Milestone

Comments

@cdrini
Copy link
Collaborator

cdrini commented Sep 20, 2019

Is your feature request related to a problem? Please describe.

We have ratings now; we should show them on the search results improve our SEO.

Describe the solution you'd like

Ratings appear alongside openlibrary search results.

Proposal & Constraints

Google has documentation about how to do stuff like this: https://developers.google.com/search/docs/data-types/review-snippet

Additional context

E.g. compare openlibrary results with GoodReads results:

Open Library GoodReads
image image
@cdrini cdrini added Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed] Good First Issue Easy issue. Good for newcomers. [managed] labels Sep 20, 2019
@hunterji
Copy link

hunterji commented Sep 22, 2019

Google pulls these from schemas for each item defined by schema.org. In GoodRead's case they are using schema.org/Book which makes sense. Inside that is an AggregateRating schema. This is what the stars are based on.

It doesn't look like openlibrary displays an aggregate rating, just ratings as part of each review. Might need to add that (visible or not).

How Google does what it does is a black box, but it looks like they want you to pull reviews from your own site (as opposed to an external site). You can't guarantee yourself the stars, but if you put in the schema it should take a week or less for them to pop up (if they are going to at all).

@cdrini
Copy link
Collaborator Author

cdrini commented Sep 24, 2019

Here's google's documentation: https://developers.google.com/search/docs/data-types/review-snippet ( added to issue ). The displayed rating on e.g. https://openlibrary.org/books/OL383855M/Harry_Potter_and_the_Chamber_of_Secrets is the average of all ratings; we don't have a feature to display individual reviews.

@mekarpeles mekarpeles added Good First Issue Easy issue. Good for newcomers. [managed] hacktoberfest Issues appropriate for Hacktoberfest participants and removed Good First Issue Easy issue. Good for newcomers. [managed] labels Sep 25, 2019
@tabshaikh tabshaikh added this to the Hacktoberfest milestone Sep 27, 2019
@tabshaikh tabshaikh added this to To do in Hacktoberfest Sep 27, 2019
@samuelpetroline
Copy link

This would require implementing microdata across many UI components.

However, I think maybe #163 has some impediments over this?

@xayhewalo xayhewalo added this to Un-Triaged in Triage Oct 20, 2019
@cdrini
Copy link
Collaborator Author

cdrini commented Oct 29, 2019

@samuelpetroline There is already microdata for a lot of UI components. This would require adding some more to probably this line in the Edition's template:

$:('<span class="readers-stats__star"></span>' * int(rating_stats['avg_rating'])) $(rating_stats['avg_rating'])

Note that file already has schema.org/Book microdata.

Triage automation moved this from Un-Triaged to Closed Nov 15, 2019
Hacktoberfest automation moved this from To do to Done Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Easy issue. Good for newcomers. [managed] hacktoberfest Issues appropriate for Hacktoberfest participants Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed]
Projects
No open projects
Hacktoberfest
  
Done
Triage
  
Closed
Development

Successfully merging a pull request may close this issue.

5 participants