Documentation

Installation

Install Vortex via NPM to use it in your Node.js projects.

npm install vortex-search-engine

Or include the browser bundle directly in your HTML:

<script src="vortex.browser.js"></script>

Quick Start

Get up and running in seconds.

const { VortexEngine } = require("vortex-search-engine");

const engine = new VortexEngine();

// 1. Add Documents
engine.addDocument("1", "Hello World", "This is my first document.");
engine.addDocument("2", "Vortex Engine", "Vortex is fast and efficient.");

// 2. Search
const results = engine.search("fast");
console.log(results);

API Reference

addDocument(id, title, content)

Adds a document to the search index.

search(query)

Searches the index for the given query string. Handles typos and synonyms automatically.

save(filepath) / load(filepath)

Persist your index to disk (Node.js only).

engine.save("./index.json");
engine.load("./index.json");