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
48
49
50
51
52
53
54
55
//! Indexing support for optimized querying.
//!
//! This module provides indexing capabilities to accelerate document queries.
//! Indexes map field values to document IDs, enabling fast lookups and range scans.
//!
//! # Index Types
//!
//! - **Unique Index**: Ensures field values are unique across all documents
//! - **Non-Unique Index**: Allows duplicate field values, maps to multiple documents
//! - **Text Index**: Full-text search index for substring and text matching
//! - **Compound Index**: Index on multiple fields for multi-field queries
//!
//! # Creating Indexes
//!
//! ```rust,ignore
//! use nitrite::index::unique_index;
//!
//! let collection = db.collection("users")?;
//! collection.create_index(vec!["email"], &unique_index())?;
//! collection.create_index(vec!["name", "age"], &non_unique_index())?;
//! ```
//!
//! # Index Management
//!
//! - **Automatic indexing**: Indexes are automatically used when applicable
//! - **Index hints**: Filters support specifying preferred indexes
//! - **Index rebuilding**: Rebuild corrupted or fragmented indexes
//! - **Index dropping**: Remove indexes to save space
//!
//! # Performance Considerations
//!
//! - Indexes speed up `find()` and filtering operations
//! - Indexes slow down insert/update/delete operations (index maintenance cost)
//! - Create indexes on frequently queried fields
//! - Unique indexes prevent duplicate values automatically
pub use *;
pub use *;
pub use *;
pub use *;