Announcing RangeSearch

Apps Software Development

Nobody looks at their WooCommerce search until it starts costing them money.

Out of the box, WordPress answers a search by scanning the posts table with a LIKE '%query%' clause. There’s no relevance ranking in that, so results come back ordered by publish date, and the query has no idea what a SKU is. Misspell one letter and you get an empty page.

Someone typing into your search box has already decided to buy something. If the results come back empty they’ll go and buy it somewhere else, and you never find out it happened.

I’ve been chipping away at this for a while. It’s called RangeSearch and it’s live now at wprangesearch.com.

It builds its own index instead of hammering the posts table. Results get scored by which field matched, with a bump for exact hits and for products that actually sell.

Suggestions come from a dedicated endpoint that boots WordPress in SHORTINIT mode, so it skips your theme and every other plugin. On my own store a query takes 3.6ms.

Some security plugins block a PHP file being hit directly like that, so it falls back to the REST API on its own. Slower, still works.

Typos get corrected against your own catalogue instead of a dictionary, so it only suggests things you actually stock. Typing “whitr” on my store finds White Stripes.

The dropdown and the results page run the same engine, so what someone sees while typing is what they get after hitting enter. It also inherits your theme’s fonts and colours rather than fighting them, and if your theme already has a search box you point RangeSearch at it with a CSS selector instead of replacing the markup.

Every search gets recorded with its result count. Go straight to the ones that returned nothing. Each of those is either a product you should stock or a synonym you should add.

There’s a free version on GitHub. Live suggestions, SKU search, category suggestions, the results page, and the analytics.

Pro adds the fast endpoint, typo tolerance, synonyms, pinned results and the rest. It’s $49 a year for one site, $99 for five, and $199 for as many as you run.

Go and use your own search box the way a customer would. Misspell something. Search a SKU. If what comes back is a pile of unrelated products sorted by publish date, the free version fixes most of that.