Ranking and paging
How search orders its results, how the cursor works, and what the frequency rank means.
The order
Search is case-insensitive across the headword prefix, every inflected surface form and, for Japanese, the reading. Results come in rank order: an exact headword first, then an exact inflected surface or reading, then the prefix matches, and within each rank the more frequent entry before the less. Alphabetical order would lose the answer outright, since a short query's prefix matches outnumber the page.
It is the same ranking immit's own apps use, so what your user sees first is what a learner on immit sees first.
Paging
A page is at most 25 entries; a larger limit is capped, not refused. metadata.after is the cursor for the next page and metadata.before for the previous; both are null at the ends. Pass one back as after or before with the same query. Without a query the list is in headword order.
The frequency rank
frequency_rank is the entry's place in its language by corpus frequency, 1 the most frequent, null unranked. immit's display bands are a reasonable default for a client:
| Band | English, rank up to | Japanese, rank up to |
|---|---|---|
| Very common | 2,000 | 2,000 |
| Common | 8,000 | 10,000 |
| Uncommon | 20,000 | 30,000 |
| Rare | 50,000 | 60,000 |
| Very rare | beyond, or null | beyond, or null |