o
odinpkg.dev
packages / app / odastic

odastic

6520289app

A fast, multi-threaded LSM-tree based search engine library written in Odin with BM25 ranking.

No license · updated 6 months ago

Odastic

A lightweight, multi-threaded LSM-tree based search engine library written in Odin.

Features

  • LSM-Tree Architecture: Efficient indexing with memory table and disk segments.
  • BM25 Ranking: State-of-the-art relevance scoring.
  • Zlib Compression: Compressed disk storage for documents and postings.
  • VByte Encoding: Variable-byte integer compression for inverted index.
  • Multi-threaded Search: Parallel segment scanning using all CPU cores.
  • Highlighter: Fast snippet generation with HTML-like tags.
  • Compaction: Automatic merging of disk segments to optimize performance.

Usage

Add the odastic folder to your project and import it.

import "odastic"

idx := odastic.create_index("my_index", "./data")
odastic.add_to_index(idx, 1, "Hello Odin", transmute([]byte)"{\"text\": \"Hello Odin\"}")
odastic.flush(idx)

results := odastic.search(idx, "odin")