Universal search for the Glyph family

Offline-first full-text ranking with profile tuning, extended query grammar, and a clean API — powering Obsidian plugins, web apps, and future Glyph products.

View on GitHub API reference
v2.7.0 createSearchEngine CJS + ESM offline-first

What’s new in 2.7

A staged refactor that keeps backward compatibility while adding performance profiles, richer queries, and a modern engine API.

Profile-based ranking

Three built-in profiles tune fuzzy cutoff, score scaling, and candidate limits. Switch at runtime without rebuilding the index.

createSearchEngine()

High-level API: pass items once, get a reusable engine with .search(query). Includes buildIndex() for pre-computed text bags.

Extended query grammar

Quoted phrases, negation (-term), OR groups ((a OR b)), and structured filters: path:, tag:, type:, page:, app:.

Performance caches

Token-variant expansion and snippet generation are memoized per profile. Diagnostics hook reports candidate counts and elapsed time.

Search profiles

ProfileFuzzy cutoffScore scaleMax candidatesUse case
legacy0.401.008 000Pre-2.7 compatibility
balanced0.481.084 000Daily use (default)
max-quality0.351.169 000Maximum recall

Query language

Compose precise searches with filters, phrases, and boolean groups.

"deep work" -draft
path:projects/
tag:evergreen
(idea OR draft) type:note

Phrases

Double-quoted strings match as contiguous text: "meeting notes"

Exclusions

Prefix with - to filter out: -archive

OR groups

Parentheses with OR: (task OR todo)

API quick start

ESM import for modern apps; CJS bundle for Obsidian plugins and Node.

import { createSearchEngine } from './lib/index.js'; const engine = createSearchEngine({ profile: 'balanced', items: [{ cat: 'note', title: () => 'Project Alpha', sub: 'docs/alpha.md', keys: ['alpha', 'project'], body: () => 'Alpha project planning and milestones', }], }); const results = engine.search('alpha planning'); // [{ item, score, snippet, ... }]

Where glyph-s runs

One engine, multiple delivery formats.

Obsidian

glyph-sO plugin

CJS bundle in vendor/engine.js. Full vault indexing with keyboard navigation and snippet previews.

Web

Floke site bundle

glyph-search-2.7.js exposes globalThis.GlyphS for browser-side search in Floke products.

ESM

Direct import

lib/index.js exports the full API for Node, bundlers, and custom integrations.

Glyph 2.7 family

Search and metadata intelligence, built to work together.