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