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

Ability to sort search results by classification, random #4607

Merged

Conversation

cdrini
Copy link
Collaborator

@cdrini cdrini commented Feb 15, 2021

Closes #3574

Adds ability to sort by lcc/ddc to /search and /search.json

Technical

  • Note we're using the ddc_sort/lcc_sort fields, because solr does not support sorting on multi-valued fields, which is what ddc and lcc are. This does mean that some things will appear out of order when doing e.g. ddc:8* sorted by ddc_sort. So I also exposed ddc_sort as a search field we can use -- although this has the caveat that some works will be missing.
  • Random sorting from the UI will (for now) always use the same seed, so that results are in a consistent order as you paginate. Longer term we might want a way to use another seed, or maybe use a seed that's relative to today, so that the order changes daily? The URLs do let you do e.g. sort=random_my_seed to get a new random.

Testing

Screenshot

Stakeholders

@cdrini cdrini added the On Staging On staging.openlibrary.org label Feb 15, 2021
@cdrini cdrini force-pushed the 3574/feature/search-classification-sort branch 2 times, most recently from d56bcf7 to 721693f Compare February 15, 2021 18:31
@cdrini cdrini changed the title Ability to sort search results by classification Ability to sort search results by classification, title, random Feb 15, 2021
@cdrini cdrini force-pushed the 3574/feature/search-classification-sort branch from 721693f to 75cd857 Compare February 15, 2021 18:45
The results are _sort of_ correct, but lots of wrong entries. Not sure why.
@cdrini cdrini changed the title Ability to sort search results by classification, title, random Ability to sort search results by classification, random Feb 15, 2021
@mekarpeles mekarpeles self-assigned this Feb 17, 2021
Copy link
Member

@mekarpeles mekarpeles left a comment

Choose a reason for hiding this comment

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

lgtm, tested on staging v. prod

@mekarpeles mekarpeles merged commit cffd425 into internetarchive:master Feb 22, 2021
@cdrini cdrini deleted the 3574/feature/search-classification-sort branch February 22, 2021 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Staging On staging.openlibrary.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Searching should support sorting by classifications
2 participants