Crate typstify_search

Crate typstify_search 

Source
Expand description

Typstify Search Library

Search index generation with Tantivy for full-text search capabilities.

§Features

  • Tantivy-based indexing: Full-text search with language-aware tokenization
  • Index chunking: Split large indexes for efficient browser loading
  • Simple index: Lightweight JSON-based alternative for small sites

§Example

use std::path::Path;

use typstify_search::{IndexerConfig, SearchIndexer, SimpleSearchIndex};

// Build a Tantivy index
let indexer =
    SearchIndexer::new(Path::new("./search-index"), IndexerConfig::default()).unwrap();
// indexer.index_pages(&pages)?;

// Or use simple JSON index for small sites
// let simple_index = SimpleSearchIndex::from_pages(&pages);
// simple_index.write_to_file(Path::new("search.json"))?;

Re-exports§

pub use chunker::ChunkerConfig;
pub use chunker::FileManifest;
pub use chunker::IndexChunker;
pub use chunker::IndexManifest;
pub use indexer::IndexStats;
pub use indexer::IndexerConfig;
pub use indexer::SearchIndexer;
pub use schema::SearchFields;
pub use schema::create_search_schema;
pub use schema::register_tokenizers;
pub use simple::MAX_SIMPLE_INDEX_SIZE;
pub use simple::SimpleDocument;
pub use simple::SimpleSearchIndex;

Modules§

chunker
Index chunking for efficient client-side loading.
indexer
Search indexer for building Tantivy indexes.
schema
Search schema definition for Tantivy.
simple
Simple JSON-based search index for small sites.

Enums§

SearchError
Search-related errors.

Type Aliases§

Result
Result type for search operations.