lucisearch 0.8.1

Embeddable, in-process search engine — the SQLite/DuckDB of search
Documentation
# lucisearch

> The SQLite/DuckDB of search — an embeddable, in-process search engine written in Rust.

No cluster to manage. No HTTP layer. No JVM. Open a file and search.

> **Crate name vs. import name:** this library publishes to crates.io as
> `lucisearch` (the bare `luci` name was already taken), but the crate
> itself is `luci` — add `lucisearch` and write `use luci::…`. Same story
> on PyPI: install `lucisearch`, import `luci`.

## Features

- **Full-text search** with BM25 scoring, analyzers, phrase queries
- **Vector search** with HNSW, int8 quantization, pre-filtering
- **Hybrid search** with Reciprocal Rank Fusion
- **Aggregations** — terms, avg, sum, min, max, stats, range, histogram, cardinality, percentiles
- **Geospatial** — geo_distance, geo_bounding_box, geo_shape (intersects, within, disjoint, …)
- **Nested documents** with block-join queries and inner_hits
- **Single-file storage** — one `.luci` file, no directory sprawl
- **Lazy result materialization** — only compute source, highlight, explain on access

## Quick Start

```toml
[dependencies]
lucisearch = "0.8"
```

```rust
use luci::index::Index;
use luci::search::expression::SearchExpression;
use serde_json::json;

let schema = json!({
    "properties": {
        "title": {"type": "text"},
        "tag":   {"type": "keyword"},
    }
});

let mut index = Index::create("my_index.luci", schema)?;

index.bulk(vec![
    json!({"title": "Hello world", "tag": "greeting"}),
    json!({"title": "Search engines", "tag": "tech"}),
])?;

// Queries are ES-compatible JSON.
let expr = SearchExpression::from_json(json!({"match": {"title": "hello"}}), 10)?;
let results = index.search(&expr)?;
for hit in results.iter() {
    println!("{:.2} {:?}", hit.score(), hit.source());
}
```

## Field Types

| Type | Status |
|------|--------|
| `text` | Supported |
| `keyword` | Supported |
| `integer`, `long`, `float`, `double` | Supported |
| `boolean` | Supported |
| `date` | Supported |
| `dense_vector` | Supported (cosine, L2, dot product, int8 quantization) |
| `geo_point` | Supported |
| `geo_shape` | Supported (polygon, multipolygon, all spatial relations) |
| `nested` | Supported |

## Python

Also available as a Python package — `pip install lucisearch` (import
`luci`) — with the same ES-compatible dict API plus a typed,
Pydantic-validated query builder.

## License

MIT