Struct summa_core::components::IndexHolder
source · pub struct IndexHolder { /* private fields */ }Implementations§
source§impl IndexHolder
impl IndexHolder
sourcepub fn create_holder(
core_config: &Config,
index: Index,
index_name: &str,
index_engine_config: Arc<dyn ConfigProxy<IndexEngineConfig>>,
merge_policy: Option<MergePolicy>,
query_parser_config: QueryParserConfig
) -> SummaResult<IndexHolder>
pub fn create_holder( core_config: &Config, index: Index, index_name: &str, index_engine_config: Arc<dyn ConfigProxy<IndexEngineConfig>>, merge_policy: Option<MergePolicy>, query_parser_config: QueryParserConfig ) -> SummaResult<IndexHolder>
Sets up IndexHolder
sourcepub fn create_memory_index(index_builder: IndexBuilder) -> SummaResult<Index>
pub fn create_memory_index(index_builder: IndexBuilder) -> SummaResult<Index>
Creates index and sets it up via setup
pub async fn open_remote_index<TExternalRequest: ExternalRequest + 'static, TExternalRequestGenerator: ExternalRequestGenerator<TExternalRequest> + 'static>( remote_engine_config: RemoteEngineConfig, read_hotcache: bool ) -> SummaResult<Index>
sourcepub fn compression(&self) -> Compression
pub fn compression(&self) -> Compression
Compression
sourcepub fn index_attributes(&self) -> Option<&IndexAttributes>
pub fn index_attributes(&self) -> Option<&IndexAttributes>
Load index attributes from meta.json
sourcepub fn conflict_strategy(&self) -> ConflictStrategy
pub fn conflict_strategy(&self) -> ConflictStrategy
How to resolve conflicts on inserting new documents
sourcepub fn index_name(&self) -> &str
pub fn index_name(&self) -> &str
Index name
sourcepub fn index_reader(&self) -> &IndexReader
pub fn index_reader(&self) -> &IndexReader
IndexReader singleton
pub fn index_engine_config(&self) -> &Arc<dyn ConfigProxy<IndexEngineConfig>>
pub fn index_writer_holder( &self ) -> SummaResult<&Arc<RwLock<IndexWriterHolder>>>
sourcepub fn multi_fields(&self) -> &HashSet<Field>
pub fn multi_fields(&self) -> &HashSet<Field>
Multi fields
sourcepub fn real_directory(&self) -> &dyn Directory
pub fn real_directory(&self) -> &dyn Directory
Return internal Tantivy index
sourcepub async fn partial_warmup<T: AsRef<str>>(
&self,
load_dictionaries: bool,
fields: &[T]
) -> SummaResult<()>
pub async fn partial_warmup<T: AsRef<str>>( &self, load_dictionaries: bool, fields: &[T] ) -> SummaResult<()>
Load term dictionaries into memory
sourcepub async fn full_warmup(&self) -> SummaResult<()>
pub async fn full_warmup(&self) -> SummaResult<()>
Load all index files into memory
sourcepub async fn search_in_segments(
&self,
searcher: &Searcher,
query: &dyn Query,
collector: &MultiCollector<'_>,
is_fieldnorms_scoring_enabled: Option<bool>
) -> Result<MultiFruit>
pub async fn search_in_segments( &self, searcher: &Searcher, query: &dyn Query, collector: &MultiCollector<'_>, is_fieldnorms_scoring_enabled: Option<bool> ) -> Result<MultiFruit>
Runs a query on the segment readers wrapped by the searcher asynchronously.
pub async fn search( &self, index_alias: &str, query: Query, collectors: Vec<Collector> ) -> SummaResult<Vec<IntermediateExtractionResult>>
sourcepub async fn custom_search(
&self,
index_alias: &str,
query: Query,
collectors: Vec<Collector>,
is_fieldnorms_scoring_enabled: Option<bool>,
load_cache: Option<bool>,
store_cache: Option<bool>
) -> SummaResult<Vec<IntermediateExtractionResult>>
pub async fn custom_search( &self, index_alias: &str, query: Query, collectors: Vec<Collector>, is_fieldnorms_scoring_enabled: Option<bool>, load_cache: Option<bool>, store_cache: Option<bool> ) -> SummaResult<Vec<IntermediateExtractionResult>>
Search query in the IndexHolder and collecting Fruit with a list of collectors
sourcepub async fn delete_documents(&self, query: Query) -> SummaResult<u64>
pub async fn delete_documents(&self, query: Query) -> SummaResult<u64>
Delete SummaDocument by unq
sourcepub async fn index_document(
&self,
document: SummaDocument<'_>
) -> SummaResult<()>
pub async fn index_document( &self, document: SummaDocument<'_> ) -> SummaResult<()>
Index generic SummaDocument
IndexUpdater bounds unbounded SummaDocument inside
sourcepub async fn index_bulk(
&self,
documents: &Vec<Vec<u8>>,
conflict_strategy: Option<ConflictStrategy>
) -> SummaResult<(u64, u64)>
pub async fn index_bulk( &self, documents: &Vec<Vec<u8>>, conflict_strategy: Option<ConflictStrategy> ) -> SummaResult<(u64, u64)>
Index multiple documents at a time
pub fn space_usage(&self) -> SummaResult<SearcherSpaceUsage>
pub fn clear_collector_cache(&self)
Trait Implementations§
source§impl Debug for IndexHolder
impl Debug for IndexHolder
source§impl Hash for IndexHolder
impl Hash for IndexHolder
Auto Trait Implementations§
impl !RefUnwindSafe for IndexHolder
impl Send for IndexHolder
impl Sync for IndexHolder
impl Unpin for IndexHolder
impl !UnwindSafe for IndexHolder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.