Skip to main content

hermes_core/structures/
mod.rs

1//! Core data structures for indexing
2//!
3//! Organized into submodules:
4//! - `postings` - Posting list compression formats
5//! - `vector` - Global IVF-PQ and binary IVF indexing
6//! - `simd` - SIMD utilities
7//! - `sstable` - SSTable for term dictionary
8
9pub mod fast_field;
10pub mod postings;
11pub mod simd;
12mod sstable;
13mod sstable_index;
14pub mod vector;
15
16// Re-export postings
17pub use postings::{
18    BlockPostingIterator,
19    BlockPostingList,
20    // Sparse vector
21    BlockSparsePostingIterator,
22    BlockSparsePostingList,
23    // Posting common
24    COMMON_BLOCK_SIZE,
25    // Posting format
26    CompressedPostingIterator,
27    CompressedPostingList,
28    CompressionStats,
29    // Elias-Fano
30    EliasFano,
31    EliasFanoIterator,
32    EliasFanoPostingIterator,
33    EliasFanoPostingList,
34    // Horizontal BP128
35    HORIZONTAL_BP128_BLOCK_SIZE,
36    HorizontalBP128Block,
37    HorizontalBP128Iterator,
38    HorizontalBP128PostingList,
39    INLINE_THRESHOLD,
40    IndexOptimization,
41    IndexSize,
42    // Positions
43    MAX_ELEMENT_ORDINAL,
44    MAX_TOKEN_POSITION,
45    // OptP4D
46    OPT_P4D_BLOCK_SIZE,
47    OptP4DBlock,
48    OptP4DIterator,
49    OptP4DPostingList,
50    PARTITIONED_EF_THRESHOLD,
51    // Partitioned EF
52    PEF_BLOCK_SIZE,
53    PEFBlockInfo,
54    // Basic posting
55    POSTING_BLOCK_SIZE,
56    PartitionedEFPostingIterator,
57    PartitionedEFPostingList,
58    PartitionedEliasFano,
59    PositionPostingIterator,
60    PositionPostingList,
61    Posting,
62    PostingFormat,
63    PostingList,
64    PostingListIterator,
65    PostingWithPositions,
66    QueryWeighting,
67    // Roaring
68    ROARING_BLOCK_SIZE,
69    ROARING_THRESHOLD_RATIO,
70    // Rounded BP128
71    ROUNDED_BP128_BLOCK_SIZE,
72    RoaringBitmap,
73    RoaringBlockInfo,
74    RoaringIterator,
75    RoaringPostingIterator,
76    RoaringPostingList,
77    RoundedBP128Block,
78    RoundedBP128Iterator,
79    RoundedBP128PostingList,
80    RoundedBitWidth,
81    SMALL_BLOCK_SIZE,
82    SMALL_BLOCK_THRESHOLD,
83    SPARSE_BLOCK_SIZE,
84    SkipEntry,
85    SkipList,
86    SparseBlock,
87    SparseEntry,
88    SparseFormat,
89    SparsePosting,
90    SparsePostingIterator,
91    SparsePostingList,
92    SparseQueryConfig,
93    SparseSkipEntry,
94    SparseSkipList,
95    SparseVector,
96    SparseVectorConfig,
97    TERMINATED,
98    // Vertical BP128
99    VERTICAL_BP128_BLOCK_SIZE,
100    VerticalBP128Block,
101    VerticalBP128Iterator,
102    VerticalBP128PostingList,
103    WeightQuantization,
104    binary_search_block,
105    decode_element_ordinal,
106    decode_token_position,
107    encode_position,
108    optimal_partition,
109    pack_block,
110    pack_deltas_fixed,
111    pack_vertical,
112    read_doc_id_block,
113    read_vint,
114    unpack_block,
115    unpack_block_n,
116    unpack_deltas_fixed,
117    unpack_vertical,
118    write_doc_id_block,
119    write_vint,
120};
121
122// Re-export vector
123pub use vector::{
124    BinaryCoarseQuantizer,
125    BinaryIvfConfig,
126    BinaryIvfIndex,
127    // IVF core
128    CoarseCentroids,
129    CoarseConfig,
130    // Quantization
131    DistanceTable,
132    // Indexes
133    IVFPQConfig,
134    IVFPQIndex,
135    IvfPqQueryPlan,
136    IvfProbePlan,
137    MultiAssignment,
138    PQCodebook,
139    PQConfig,
140    SoarConfig,
141};
142
143// Re-export simd
144pub use simd::bits_needed;
145
146// Re-export sstable
147pub use sstable::{
148    AsyncSSTableIterator, AsyncSSTableReader, BLOCK_SIZE as SSTABLE_BLOCK_SIZE, BloomFilter,
149    SSTABLE_MAGIC, SSTableStats, SSTableValue, SSTableWriter, SSTableWriterConfig, SparseDimInfo,
150    TermInfo,
151};
152
153// Re-export sstable_index
154#[cfg(feature = "fst-index")]
155pub use sstable_index::FstBlockIndex;
156pub use sstable_index::{BlockAddr, BlockAddrStore, BlockIndex, MmapBlockIndex};