Trait lance_index::traits::DatasetIndexExt
source · pub trait DatasetIndexExt {
// Required methods
fn create_index<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
columns: &'life1 [&'life2 str],
index_type: IndexType,
name: Option<String>,
params: &'life3 dyn IndexParams,
replace: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn load_indices<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Arc<Vec<Index>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_scalar_index_for_column<'life0, 'life1, 'async_trait>(
&'life0 self,
col: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn optimize_indices<'life0, 'life1, 'async_trait>(
&'life0 mut self,
options: &'life1 OptimizeOptions
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn index_statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn load_index<'life0, 'life1, 'async_trait>(
&'life0 self,
uuid: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn load_indices_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Index>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Required Methods§
sourcefn create_index<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
columns: &'life1 [&'life2 str],
index_type: IndexType,
name: Option<String>,
params: &'life3 dyn IndexParams,
replace: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_index<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
columns: &'life1 [&'life2 str],
index_type: IndexType,
name: Option<String>,
params: &'life3 dyn IndexParams,
replace: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Create indices on columns.
Upon finish, a new dataset version is generated.
Parameters:
columns: the columns to build the indices on.index_type: specifyIndexType.name: optional index name. Must be unique in the dataset. if not provided, it will auto-generate one.params: index parameters.replace: replace the existing index if it exists.
sourcefn load_indices<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Arc<Vec<Index>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_indices<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Arc<Vec<Index>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read all indices of this Dataset version.
The indices are lazy loaded and cached in memory within the [Dataset] instance.
The cache is invalidated when the dataset version (Manifest) is changed.
sourcefn load_scalar_index_for_column<'life0, 'life1, 'async_trait>(
&'life0 self,
col: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_scalar_index_for_column<'life0, 'life1, 'async_trait>(
&'life0 self,
col: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads a specific index with the given index name.
sourcefn optimize_indices<'life0, 'life1, 'async_trait>(
&'life0 mut self,
options: &'life1 OptimizeOptions
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn optimize_indices<'life0, 'life1, 'async_trait>(
&'life0 mut self,
options: &'life1 OptimizeOptions
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Optimize indices.
sourcefn index_statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn index_statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find index with a given index_name and return its serialized statistics.
If the index does not exist, return Error.
Provided Methods§
sourcefn load_index<'life0, 'life1, 'async_trait>(
&'life0 self,
uuid: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_index<'life0, 'life1, 'async_trait>(
&'life0 self,
uuid: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads all the indies of a given UUID.
Note that it is possible to have multiple indices with the same UUID, as they are the deltas of the same index.
sourcefn load_indices_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Index>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_indices_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Index>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads a specific index with the given index name
§Returns
Ok(indices): if the index exists, returns the index.Ok(vec![]): if the index does not exist.Err(e): if there is an error loading indices.