Search on One Kings Lane
This is a search engine I built that runs in your browser, and you can type anything into it. Plain search only matches the exact words you typed, and my search forgives typos and looks for meaning when no word matches. Pick a kind of shopper and my search reorders its results for what that shopper has looked at.
- Object
- Art
- Place
- Person
- Idea
Shoppers
Plain search
No results
My search
No results
Luxley Brass Crystal Chandelier Small
Yunlan Carved Wood Silk Chandelier
Adelmere Brass Six-Light Chandelier
Duskmere Brass Lantern Chandelier
Adelmere Brass Pleated Shade Chandelier
1Instant answer
Every keystroke gets an answer right away from a table built ahead of time. The personalized answer replaces it as soon as it is ready. An empty box shows what the shopper looked at last.
Table CacheResults are cached per shopper and query. The products a query finds are cached once for every shopper, so a new shopper only reruns ranking. When a shopper looks at a product, their cached results are dropped. Word vectors are split into files by a word’s first two letters, and a file is fetched the first time a search needs a word in it. LatencyEach bar is one stage of this search, timed in your browser. Each stage is run many times and averaged, because one run is too fast for the browser’s clock. If the answer is not ready by the deadline, the page shows the table’s answer, or the best sellers among the products found. 2Finding products
Words are matched against each product’s title and terms and scored with BM25, a standard text score. One wrong letter is forgiven in a word of four to seven letters, and two in a longer word. Embeddings run only when no word matches. There is no synonym table. Words like “she” or “why” are searched when they are the whole query.
EmbeddingsAn embedding is a list of numbers that stands for a word’s meaning. Each strip is one vector of 100 numbers: the query on top, then the top products with their cosine similarity to the query. The star beside each strip is drawn from the same numbers. ESCIEach query and product pair gets a grade: Exact, Substitute, Complement or Irrelevant (ESCI). The scheme is from Amazon’s public Shopping Queries dataset, where people assigned the grades. Here a rule assigns them, and the grade is one of the ranker’s features. 3Ranking
Boosted decision trees (LightGBM) predict expected revenue: what a product earns when it is shown and then bought within a day. That is blended with a best-seller score from 28 days of orders.
Feature storeThe ranker reads its features from three shelves: one row per shopper, one per product, and one per query and product pair. Age is how long ago a row was written in this tab. Training rowsThe trees were trained on simulated shoppers. A row is one product shown in one search. The label is its revenue: the price if it was bought within a day, zero if not. A row lower on the page gets more weight, because fewer shoppers look that far down. TreesEach bar is what one feature added to or took from the picked product’s expected revenue. Model is each feature’s share of the gain in the trees. 4Rules
Only products that are in stock and have a price are shown, one per product family, inside the category the query names.
Rules
This is a working copy on a made-up catalog: 202 products drawn from Poly Haven’s models, and 895 entries from outside the shop (art, objects, people, places and ideas), each listed as a print, a book, a cast or another form it could be sold in. Their pictures come from open museum collections, NASA, Wellcome Collection and Wikimedia Commons. Prices and sales are made up. The shoppers are simulated. Word vectors are GloVe. Plain search matches the words exactly as typed and lists every variant. None of the store’s data is here. Nothing you type leaves this page.














