Skip to main content

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