MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / add_index

Method add_index

nodedb-vector/src/collection/payload_index.rs:261–266  ·  view source on GitHub ↗

Register a new field index. Idempotent — safe to call multiple times for the same field (subsequent calls are no-ops).

(&mut self, field: impl Into<String>, kind: PayloadIndexKind)

Source from the content-addressed store, hash-verified

259 /// Register a new field index. Idempotent — safe to call multiple times for
260 /// the same field (subsequent calls are no-ops).
261 pub fn add_index(&mut self, field: impl Into<String>, kind: PayloadIndexKind) {
262 let field = field.into();
263 self.indexes
264 .entry(field.clone())
265 .or_insert_with(|| PayloadIndex::new(field, kind));
266 }
267
268 /// Returns `true` if any index is registered.
269 pub fn is_empty(&self) -> bool {

Callers 8

pre_filter_equalityFunction · 0.45
pre_filter_andFunction · 0.45
pre_filter_orFunction · 0.45
snapshot_roundtripFunction · 0.45

Calls 2

entryMethod · 0.80
cloneMethod · 0.45

Tested by 7

pre_filter_equalityFunction · 0.36
pre_filter_andFunction · 0.36
pre_filter_orFunction · 0.36
snapshot_roundtripFunction · 0.36