Add a real-time search-as-you-type feature to a documentation site or blog without a backend search service
Build an autocomplete input that returns ranked completion suggestions as the user types
Search a JSON dataset in a browser app without sending data to any server
Add full-text search with fuzzy matching and typo tolerance to a Node.js application
Index must fit in browser or server RAM, not suited for datasets too large to hold in memory.
MiniSearch is a JavaScript library that adds full-text search to a web application or Node.js server without needing any external search service. It stores the entire search index in memory, which means searches happen instantly and the app does not need to send requests to a separate server to get results. This makes it well suited for real-time "search as you type" features where speed matters. The library works by taking a set of documents you provide, indexing the fields you care about (such as a title or a body of text), and then letting you run searches against those documents. Search results are ranked by relevance. It supports several types of search: exact word matching, prefix matching (so a partial word like "moto" matches "motorcycle"), and fuzzy matching (which tolerates small spelling mistakes). You can also boost certain fields so that a match in the title counts more than a match in the body text, and filter results by any property on your documents. There is also an auto-suggestion feature: give it a partial query and it returns ranked completion suggestions, which is the backbone of a search-as-you-type autocomplete input. Documents can be added or removed from the index at any time without rebuilding it from scratch. The library has no external dependencies and is small in size, which is important for browser use where download size affects page load time. It can be installed via npm or yarn, or loaded directly in a browser via a script tag from a CDN. MiniSearch is a code library, not a standalone application, so it is intended for developers building web apps or server-side applications that need search functionality over a dataset that fits in memory. It is not a replacement for large-scale search infrastructure, it is designed for collections that are small enough to keep in RAM on a single machine or in a browser tab.
← lucaong on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.