IQ Bible API v2: Search Now Returns True Canonical Order

GET /bibles/{version}/search's default sort=canonical wasn't sorting canonically. It's fixed now, and cursor-based paging changed to match. Here's what that means for a canonical-sort search in flight.

Search now returns true canonical order

Since 2.0.0-rc.1

GET /bibles/{version}/search takes a sort=canonical parameter, and it’s the default. It’s supposed to hand results back in Bible order, Genesis to Revelation. It didn’t.

It ordered by a row’s internal id, which tracks when a verse was inserted into the database, not where it sits in the canon. For most versions those two orders happen to line up. For at least one, eng_kjv, they don’t. A search could show Chronicles ahead of Genesis.

Fixed now. Results order by the same canonical-order column the rest of the codebase already uses.

One thing changes with it. cursor-based paging now encodes a position in that canonical order instead of a raw row id. The cursor was always meant to be opaque. You were only ever supposed to echo back the next_cursor you got, so nothing about the request or response shape is different. But a cursor value you got before this fix won’t decode into anything valid after it. If you’re mid-way through paging a canonical-sort search across this deploy, start that page sequence over from page one.

Small, real fixes like this are what an RC is for. 2.0.0 gets closer every time one lands clean.

Already building against the API? Check it out in the developer portal and keep going. Not yet? Get a free API key and make your first request today.

We build the biblical data infrastructure. You build the tools that help people encounter God’s Word. Build boldly, build well.

Gephen v0.22.0