pub struct SQLiteBTreeIndexStore { /* private fields */ }Implementations§
Source§impl SQLiteBTreeIndexStore
impl SQLiteBTreeIndexStore
pub fn new(conn: ManagedConnection) -> Self
pub fn fields(&self, table: &str) -> Result<Vec<ValueIndexKey>>
pub fn repairs(&self) -> Result<Vec<(String, ValueIndexKey)>>
pub fn clear_repair(&self, table: &str, field: &ValueIndexKey) -> Result<()>
Sourcepub fn load(
&self,
table: &str,
field: &ValueIndexKey,
) -> Result<Option<Vec<(DocId, Value)>>>
pub fn load( &self, table: &str, field: &ValueIndexKey, ) -> Result<Option<Vec<(DocId, Value)>>>
Load a complete persisted index. None means this field has not been
built yet and the engine must backfill it from the document store once.
Sourcepub fn replace(
&self,
table: &str,
field: &ValueIndexKey,
values: &[(DocId, Value)],
) -> Result<()>
pub fn replace( &self, table: &str, field: &ValueIndexKey, values: &[(DocId, Value)], ) -> Result<()>
Atomically replace the complete persisted posting set and mark it built.
Sourcepub fn repair(
&self,
table: &str,
field: &ValueIndexKey,
stale_doc_ids: &[DocId],
missing: &[(DocId, Value)],
) -> Result<()>
pub fn repair( &self, table: &str, field: &ValueIndexKey, stale_doc_ids: &[DocId], missing: &[(DocId, Value)], ) -> Result<()>
Apply a sparse structural repair while retaining every valid posting. All ids and values are encoded before opening the savepoint so a range or serialization error cannot leave half of the delta applied.
Sourcepub fn replace_many(
&self,
table: &str,
indexes: &[(&ValueIndexKey, &[(DocId, Value)])],
) -> Result<()>
pub fn replace_many( &self, table: &str, indexes: &[(&ValueIndexKey, &[(DocId, Value)])], ) -> Result<()>
Atomically replace several complete posting sets for one table. Repair
paths commonly rebuild every indexed column together; one savepoint and
one set of prepared statements avoids repeating SQLite setup per field.
Sourcepub fn apply_write(
&self,
table: &str,
doc_id: DocId,
values: Option<&BTreeMap<ValueIndexKey, Value>>,
) -> Result<()>
pub fn apply_write( &self, table: &str, doc_id: DocId, values: Option<&BTreeMap<ValueIndexKey, Value>>, ) -> Result<()>
Apply one document write to every persisted field currently loaded by
the engine. A replacement uses the (table, field, doc_id) primary key,
so updates never need a separate old-value delete.
pub fn drop_index(&self, table: &str, field: &ValueIndexKey) -> Result<()>
Sourcepub fn clear_table(&self, table: &str) -> Result<()>
pub fn clear_table(&self, table: &str) -> Result<()>
TRUNCATE keeps the index definitions but removes every posting.
Trait Implementations§
Source§impl Clone for SQLiteBTreeIndexStore
impl Clone for SQLiteBTreeIndexStore
Source§fn clone(&self) -> SQLiteBTreeIndexStore
fn clone(&self) -> SQLiteBTreeIndexStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more