[KongchangAI]
· 2 min read· 1,034 words

MiniSearch: Adding Fuzzy Tolerance and Relevance Ranking to AI Search Boxes

MiniSearch: Adding Fuzzy Tolerance and Relevance Ranking to AI Search Boxes

A Bilibili creator demonstrates using MiniSearch for browser-side fuzzy product search with tolerance, multi-field, and relevance ranking.

The article introduces a lightweight frontend search transformation: using MiniSearch, a full-text search engine running in the browser, to upgrade precise search in activity shelves and in-site product retrieval to fuzzy search. Video tests show that typos like "wireless earphnes" still return correct products, keywords not in titles like "quiet" can be hit through selling points, and results are ranked by relevance; in contrast, the AI self-selected path returns zero results for one typo, empty results in multi-field scenarios, and unordered rankings. The article concludes that when frontend scenarios need tolerance, multi-field coverage, and relevance ranking simultaneously, MiniSearch can be directly specified, but it is not a replacement for large backend retrieval systems—data scale, index costs, and Chinese tokenization still require business validation.

In scenarios like activity shelves and in-site product search, the search box experience directly determines whether users can find the products they want. Recently, a creator on Bilibili demonstrated a lightweight solution: having AI transform precise search into fuzzy search, using the browser-side full-text search engine MiniSearch.

In the video, a set of product data was used for testing: entering "wireless earphones" where the character "phone" was not the correct writing of "earphone," the system still returned correct results; entering "recording light" and "thermos" also hit the corresponding products; replacing the character "thermos" with a typo, correct results could still be found. This fault-tolerance capability is a typical manifestation of MiniSearch performing full-text fuzzy search in the browser.

Search results for thermos input

What is MiniSearch: A Lightweight Full-Text Search Engine in the Browser

According to the video description, MiniSearch is a lightweight full-text fuzzy search engine running in the browser, providing three core capabilities: fuzzy tolerance, multi-field search, and relevance ranking. It does not require additional backend services and is suitable for direct implementation in frontend scenarios like activity pages and in-site product lists.

This means the search logic can run entirely on the client side, which is a low-cost transformation path for activity shelf scenarios with small data volumes but high response speed requirements.

Full-text search typically relies on inverted indexes at its core: splitting text into tokens and building a mapping of "token → list of documents containing that token," so queries look up tokens directly rather than scanning original text line by line. MiniSearch also adopts this approach on the browser side, with the index built within the page and resident in memory, resulting in very low retrieval latency. However, index size and build time are positively correlated with document count and field length, so for large data volumes, first-screen loading and memory usage need to be evaluated.

For Chinese, tokenization significantly affects recall. English can be split by spaces, but Chinese requires determining the segmentation granularity first; using dictionary-free segmentation like bigrams avoids maintaining a vocabulary but increases index entries. MiniSearch itself is a general-purpose full-text search library, and Chinese scenarios usually require custom tokenization or preprocessing—this is why the article mentions that "tokenization details still need business validation."

Three Core Capabilities: Tolerance, Multi-Field, and Relevance Ranking

Fuzzy Tolerance: One Wrong Character No Longer Means Zero Results

The video compared two implementation paths. On the left is the "AI self-selected" approach, where one wrong character results in 0 results; after switching to MiniSearch, the same typo input still returns corresponding results.

This difference is crucial in real usage—user typos, wrong character selection in pinyin input methods, and inconsistent product title writing are all high-frequency situations. Once precise matching fails, users often leave directly rather than trying another word.

Fuzzy matching in engineering is generally implemented through edit distance, which measures how many insertions, deletions, or substitutions are needed to transform one string into another. Search engines typically allow a certain edit distance threshold, finding terms in the index that are "close enough" to the query term, thereby tolerating typos and input errors.

Relaxing edit distance brings two side effects: first, more recall, which may introduce irrelevant results; second, increased computation, with higher costs for prefix matching and term traversal. Therefore, in practice, it is often necessary to limit fuzziness, make trade-offs based on word length, and use relevance scoring to rank closer results first—this is why fuzzy tolerance must be paired with ranking capability.

Multi-Field Hit: Words Not in the Title Can Be Found in Selling Points

The second capability is multi-field search. The video gives an example: searching for the word "quiet," if the title does not contain this word, the AI self-selected approach returns an empty result; with MiniSearch, fields like selling points can also be hit.

Multi-field and relevance ranking

For product search, titles carry limited information, while selling points, descriptions, and specifications often contain keywords users truly care about. Multi-field search makes this information searchable content, rather than only matching against titles.

Relevance Ranking: Having Results, and Putting the Right Ones First

The third is relevance ranking. The video points out that although the AI self-selected approach can produce results, the order is not by relevance; MiniSearch ranks results with higher relevance scores first.

Result order under AI self-selected path

The value of a search box is not just "having results," but "the first result is what the user wants." Relevance ranking directly affects click-through and conversion rates, and this is the watershed between making search usable and making it good.

Comparison of AI self-selected implementation paths

Relevance ranking commonly uses weighted models like TF-IDF / BM25: the more a term appears in a document and the rarer it is across the entire index, the higher its discriminative power and weight; field weights also matter, e.g., title hits are usually more important than description hits. MiniSearch allows configuring weights for different fields and supports applying different score coefficients to prefix and fuzzy match results.

This means ranking performance is not fixed out of the box but requires tuning for the business: which fields to weight, whether fuzzy hits should be downweighted, and whether exact matches should be prioritized. The article demonstrates results under default configuration; in real product databases, repeated calibration with click data is still needed to make "the first result is what the user wants" reliably hold.

When to Explicitly Choose MiniSearch

The video provides a practical criterion: if you have AI build activity shelves or in-site product search and simultaneously need "results even with typos" and "multi-field hits with relevant results ranked first," you can directly specify MiniSearch.

In other words, it suits lightweight frontend search scenarios, not as a replacement for large backend retrieval systems. The video does not elaborate on data scale limits, index build costs, or specific Chinese tokenization handling—these still require validation against specific business needs in actual implementation.

From the demonstration, MiniSearch addresses the three most easily overlooked yet most retention-affecting aspects of search experience: tolerance, coverage, and ranking. For product managers and developers using AI to quickly build activity page search, this is an option worth adding to the toolbox.

#MiniSearch#fuzzy search#full-text search#relevance ranking#multi-field search#typo tolerance
Share:

Related articles