MCPcopy Index your code
hub / github.com/ang-zeyu/infisearch

github.com/ang-zeyu/infisearch @v0.10.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.1 ↗ · + Follow
1,082 symbols 2,925 edges 147 files 35 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

InfiSearch

CI workflow

Easy and flexible client-side search for static sites.

Description

InfiSearch is a client-side search solution made for static sites, depending on a pre-built index generated by a CLI tool.

Features

  • Relevant Search 🔍: spelling correction, automatic prefix search, boolean and phrase queries, BM25 scoring, proximity scoring, facet filters and more...
  • Speedy 🏇: WebAssembly & WebWorker powered, enabling efficient, non-blocking query processing. Backed by persistent caching to minimize network requests, and a multi-threaded CLI indexer.
  • Semi-Scalable, achieved by optionally splitting the index into tiny morsels, complete with incremental indexing.
  • A customisable, accessible user interface 🖥️
  • Support for multiple file formats (.json,csv,pdf,html) to satisfy more custom data requirements.

Documentation

The documentation, which uses InfiSearch for its search function, can be found here.

Preview

Some demos of InfiSearch on a much larger Gutenberg collection are also available here.

Getting Started

Powering static site search with InfiSearch is extremely easy, and requires just a folder of your HTML files — titles, headings, and other text are automatically extracted. Links to your pages are automatically generated based on your folder structure, but can also be manually specified.

1. Installing the indexer

There are a couple of options for installing the indexer: - Install the global npm package with npm install -g @infisearch/cli. - If you have the rust / cargo toolchains setup, run cargo install infisearch --vers 0.10.1. - You can also grab the cli binaries here.

2. Running the indexer

Run the executable as such, replacing `

with the relative or absolute folder path of your source html files, and` with your desired index output folder.

infisearch 

 <output-folder-path>

3. Installing the Search UI via CDN

Add the following resources to your pages:


<script src="https://cdn.jsdelivr.net/gh/ang-zeyu/infisearch@v0.10.1/packages/search-ui/dist/search-ui.ascii.bundle.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ang-zeyu/infisearch@v0.10.1/packages/search-ui/dist/search-ui-light.css" />

If you wish to host the files, you can find them in the <output-folder-path>/assets directory generated by the indexer, or in the releases page.

4. UI Initialisation

Give any <input> element in your page an id of infi-search, then call:

infisearch.init({
  searcherOptions: {
    // Output folder URL specified as the second parameter in the cli command
    // URLs like '/output/' will work as well
    url: 'http://<your-domain>/output/',
  },
  uiOptions: {
    // Input folder URL specified as the first parameter in the cli command
    // This is where the generated result preview links will point to,
    // and where you host your site.
    sourceFilesUrl: 'http://<your-domain>/source/',
  }
});

License

This project is MIT licensed.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 547
Method 355
Class 149
Interface 20
Enum 11

Languages

TypeScript55%
Rust45%

Modules by API surface

packages/infisearch/search-ui-dist/search-ui.chinese.bundle.js134 symbols
packages/infisearch/search-ui-dist/search-ui.ascii.bundle.js134 symbols
packages/infisearch/search-ui-dist/search-ui.ascii-stemmer.bundle.js134 symbols
packages/infisearch_search/src/searcher/query_parser.rs46 symbols
packages/infisearch_search/src/postings_list.rs23 symbols
packages/infisearch/src/field_info.rs23 symbols
packages/infisearch_search/src/searcher/query_processor.rs22 symbols
packages/search-ui/src/search/filters.ts19 symbols
packages/infisearch/src/worker/miner.rs18 symbols
packages/infisearch/src/loader/html.rs18 symbols
e2e/utils.js17 symbols
packages/infisearch/src/indexer/input_config.rs16 symbols

For agents

$ claude mcp add infisearch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page