Summary
I designed and built the search for a membership site as two tracks: a keyword search anyone can use, and a meaning-based search for subscribers only. On the free side, I made it cost nothing no matter how many times search is used. A membership site’s search carries a condition of its own: what the search is allowed to touch differs between readers who read for free and readers who subscribe. I did not fold the search into one but split it into two tracks precisely to fit this condition. This article is a record of the process of designing and building those two tracks.
Let me lay out the overall shape first. On the free side, I built a static index from the published parts alone and had the reader’s own device query it, so it costs nothing no matter how many times search is used. On the paid side, it is a search by nearness of meaning, opened only to readers who have subscribed, and here I put three separate safeguards: a brake so the cost does not swell with the number of readers, a data-layer permission so the paid body text can never leak, and a privacy structure that keeps none of the reader’s questions.
What I most want to write about in this article is two decisions where we took back something we had once built. One is how I came to throw away, in two stages, the whole store meant to cache search questions for speed, and arrived at a general line of not reusing readers’ input across readers. The other is the story of stopping a search that always returns some number of results for whatever you type, and instead honestly returning zero results for a question that does not reach a certain line of nearness of meaning, a line I decided by measurement rather than by principle. In the body readable by subscribers, I write out concretely and in order, from the two-track boundary to the data permission that stops leakage, the cost brakes, the foundation of the embeddings, the floor for zero results, and the structure that keeps no questions.
Who this is for and what you can take away
This article is for people building a membership site, or a mechanism to sell paid articles, on their own, and wondering how to provide search. You can take away the boundary that splits the build of search between free readers and paid readers, and the idea of a static index that makes the free side cost nothing. To run a paid meaning-search cheaply and safely, I also write the method of cutting cost loose from the number of readers, and the form of stopping leakage with data permissions rather than application code. I go as far as one answer to the balance between privacy and efficiency: how much of the content of a reader’s search to hold at hand, and where to stop holding it. This article is a practical record based on the process of building this very site.
The rest of this article is paid
You can read the rest by buying this article on its own, or with a subscription that covers every paid article.
The paid part is about 11,600 characters, roughly a 23-minute read.
Read just this article
From 300 JPY
Buy this article on its own. The exact price is shown at checkout. Purchased articles stay readable whenever you sign in with the email used at purchase.
Read every paid article
Standard is 490 JPY / month
Four new paid articles ship every month. For yearly billing and the full comparison, see the plans.
Add dialogue and columns
Premium is 980 JPY / month
Premium adds the subscriber-only columns and dialogue with matsumotory-kun on top of every paid article. See the plans for details.
Prices include tax. Purchases and subscriptions start after you sign in. Subscribers and readers who already bought this article can sign in and read the full article; for the plans, see the plans page.
Sales are available in supported regions only; the Terms list where we sell. All charges are in Japanese yen.