internetarchive / internetarchive/openlibrary

add sort-options to the search-inside API

Open
#4,997 1 comment 0 reactions 0 assignees View on GitHub
Lead: @mekarpeles Priority: 4
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

### Describe the problem that you'd like solved

The search-inside API currently has no way to sort the results, which is possible in the search API.

Note: sorting is also not yet possible in the search-inside web interface:
- https://openlibrary.org/search?q=water&mode=ebooks&has_fulltext=true

### Proposal & Constraints

I would like to see some basic sort-options for the inside-search API (and ideally also the web interface).

The most important options (in my opinion):
- sort by number of matches (the current default perhaps?).
- sort by relevance: which would also take into account title-matches etc. (besides the number of matches within an item), like this is done for the search API.

Other "nice to have" options would be:
- new (newest first)
- old (oldest first)
- author asc
- auther desc
- title asc
- title desc
- month/week views asc
- month/week views desc

Contributor guide

Open the contributing guide

Research direction

The issue names the search-inside API and compares it with sorting in the search API, but no files or tests are specified. Start by locating both API implementations and their sorting behavior; done means the agreed sort options work consistently in the search-inside API, with web-interface support only if that scope is confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend-api-design, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.