Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

Behind the scenes

How Wonder by Zaweba searches inside articles offline

Wonder by Zaweba builds its own full-text index of each edition in the background, so you can search inside articles with no internet.

How Wonder by Zaweba searches inside articles offline

Searching by title and searching inside articles are two different jobs, and Wonder by Zaweba treats them that way. Title suggestions appear as soon as an edition is open, read straight from the file. Searching for words inside the articles needs an index, and Wonder builds its own, quietly, the first time you ask for one.

Wonder is a free offline encyclopedia for Windows. You download an edition of Wikipedia, or a smaller one, Wiktionary or Wikivoyage, once from the Kiwix project, and from then on reading and searching need no internet at all. Full-text search is the part that lets you find an article when you remember a phrase from it but not its name.

Two kinds of search

Start typing in the search box and title suggestions come from the edition's own title index. They never need anything building, so they work even in a very large edition straight after you open it. Press Enter and Wonder opens the exact title if there is one, coping with redirects and any capitalisation. If there isn't an exact match, it searches inside articles instead.

That second step is where the full-text index comes in. It is Wonder's own, kept separately from the edition file, with one index per edition.

How the index is built

The index is a SQLite FTS5 database. For each article it holds the title and the first 3,000 characters of prose. It is built in the background the first time you search inside articles, so you can carry on reading while it works.

Two details make that practical. The index is saved every 500 articles, so if you close Wonder or restart the PC, the build carries on from where it got to rather than starting again. And it is searchable while it grows, so early searches return results from the part already indexed. Those results fill out as the build goes on.

What it covers

Because each article's index entry is its title plus the first 3,000 characters of prose, full-text search is strongest on what an article is about. The opening of a Wikipedia article usually sets out the subject, its dates, places and main ideas, so a search for a phrase or a pair of distinctive words tends to find the right page. A detail buried deep in a long article may not be in the index, so if a search comes back empty, try words that would appear early in the article you have in mind.

Pictures, tables and the rest of a page are not part of the index. It is about prose.

Planning for a big edition

Time and space depend on the edition. A small edition is indexed in seconds. Full English Wikipedia will take hours and several GB of disk space. Nothing goes wrong if you start it and walk away; the background build and the save every 500 articles mean it simply carries on whenever Wonder is running.

If disk space is tight, bear that in mind when choosing an edition in File, then Library. The full English Wikipedia with pictures is about 119 GB before any index, and the Library also offers editions without pictures, introductions only, top articles and Simple English, with each one's size shown before you download. Title search works the same on all of them and never needs the index.

Getting good results

Use title search first when you know roughly what you're after. It is instant and needs nothing building. Turn to full-text search for the half-remembered things: a phrase from a book, the name of a ship you can't place, a word you saw in a caption.

Keep searches short and distinctive. Two or three unusual words find more than a long sentence. When you find something worth keeping, Ctrl+D adds a bookmark and Ctrl+Shift+D puts it on Read later, both kept for that edition.

Search is one way into Wonder, and wandering is the other. Surprise me and Follow a random link take you places you'd never think to search for, and the full-text index is there for the moments when you do know what you are looking for. Between them, Wonder by Zaweba covers both.