daypress
admin routeSearchForm · /daypress/v1/search
doc versionv1.0.4
reading time4 min read
section group17 · Forms, Search & SEO
Docs/Forms, Search & SEO
SearchForm · /daypress/v1/search4 min readv1.0.4

SQLite FTS5 Instant Search, Cmd+K Modal & Search API

Every published post, page, and public Custom Post Type item indexes automatically in SQLite's posts_fts FTS5 virtual table—delivering Algolia-class instant search without external SaaS dependencies.

BM25 ranking, prefix matching & typo tolerance

  • Zero-Maintenance Synchronization: Creating, updating, unpublishing, or trashing any post updates posts_fts atomically inside the same SQLite transaction.
  • Weighted BM25 + Prefix Queries: Title matches rank higher than excerpt and body matches, with automatic prefix tokenization so typing migr immediately surfaces WordPress Migration.
  • Levenshtein Typo Fallback: When an exact FTS5 query returns zero hits (e.g., daystudo), Daypress automatically runs a bounded edit-distance fallback across indexed vocabulary terms.
  • Security Redaction: Drafts, future-scheduled posts, private posts, and password-protected bodies are strictly excluded from public search results.

Placing the SearchForm widget in DayStudio

json (AST)
{
  "id": "header_search",
  "type": "SearchForm",
  "data": {
    "placeholder": "Search documentation & articles...",
    "enable_instant_dropdown": true,
    "enable_keyboard_shortcut": true,   // Binds Cmd+K / Ctrl+K on public pages
    "post_types": ["post", "page", "doc"]
  },
  "styles": {}
}

Querying via REST API, MCP & Static Edge builds

http / json
# Public Instant Search REST endpoint (returns <mark class="dp-search-hl"> snippets)
GET /wp-json/daypress/v1/search?q=hot+cache&post_type=doc&limit=8

# MCP tool: daypress_search
{"query": "hot cache", "post_type": "doc", "limit": 8}
Works on Static Edge Builds Too: When you deploy via the Static Edge Publisher, Daypress compiles a pre-tokenized /search-index.json bundle so instant client-side search continues working on Cloudflare Pages and Netlify.