Expand description
Full-text search engine for Ox Content.
This crate provides a lightweight, high-performance full-text search engine for Markdown documents processed by Ox Content.
§Features
- TF-IDF based scoring for relevance ranking
- Multi-field search (title, body, headings, code)
- Prefix matching for autocomplete
- Serializable index for build-time generation
§Example
ⓘ
use ox_content_search::{SearchIndex, SearchIndexBuilder, SearchOptions};
// Build index at build time
let mut builder = SearchIndexBuilder::new();
builder.add_document("getting-started", "Getting Started", "Welcome to the docs...");
let index = builder.build();
// Serialize for client-side use
let json = index.to_json();
// Search at runtime
let results = index.search("getting started", &SearchOptions::default());Structs§
- Document
Indexer - Extracts searchable content from a Markdown AST using the Visitor pattern.
- Posting
- Posting list entry for inverted index.
- Search
Document - A searchable document in the index.
- Search
Index - The main search index structure.
- Search
Index Builder - Builder for constructing a search index.
- Search
Options - Search options.
- Search
Result - A search result with relevance score.
Enums§
- Field
- Document fields with different boost weights.