1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! `VectorCollection`: newtype wrapper around `Collection` for vector workloads.
//!
//! This type provides a stable, typed API for vector collections.
//! Internally it delegates 100% to the `Collection` executor to avoid
//! any data synchronisation issues between separate storage layers.
use crateCollection;
/// A vector collection combining HNSW search, payload storage, and full-text search.
///
/// `VectorCollection` is a typed newtype over `Collection` that provides
/// a stable public API for vector workloads. All storage operations delegate
/// to the single `inner: Collection` instance — no dual-storage desync.
///
/// # Examples
///
/// ```rust,no_run
/// use velesdb_core::{VectorCollection, DistanceMetric, Point, StorageMode};
/// use serde_json::json;
///
/// let coll = VectorCollection::create(
/// "./data/docs".into(),
/// "docs",
/// 768,
/// DistanceMetric::Cosine,
/// StorageMode::Full,
/// )?;
///
/// coll.upsert(vec![
/// Point::new(1, vec![0.1; 768], Some(json!({"title": "Hello"}))),
/// ])?;
///
/// let results = coll.search(&vec![0.1; 768], 10)?;
/// # Ok::<(), velesdb_core::Error>(())
/// ```