mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
remove useless files
This commit is contained in:
parent
6c63ee6798
commit
e9c95f6623
6 changed files with 1 additions and 1052 deletions
|
@ -1,17 +0,0 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use heed::Env;
|
||||
|
||||
use super::IndexStore;
|
||||
|
||||
pub struct UpdateStore {
|
||||
env: Env,
|
||||
index_store: Arc<IndexStore>,
|
||||
}
|
||||
|
||||
impl UpdateStore {
|
||||
pub fn new(env: Env, index_store: Arc<IndexStore>) -> anyhow::Result<Self> {
|
||||
Ok(Self { env, index_store })
|
||||
}
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
use std::sync::Arc;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use anyhow::Result;
|
||||
use milli::{Index, FieldsIdsMap, SearchResult, FieldId, facet::FacetType};
|
||||
use ouroboros::self_referencing;
|
||||
|
||||
use crate::data::SearchQuery;
|
||||
|
||||
#[self_referencing]
|
||||
pub struct IndexView {
|
||||
pub index: Arc<Index>,
|
||||
#[borrows(index)]
|
||||
#[covariant]
|
||||
pub txn: heed::RoTxn<'this>,
|
||||
uuid: String,
|
||||
}
|
||||
|
||||
impl IndexView {
|
||||
pub fn search(&self, search_query: &SearchQuery) -> Result<SearchResult> {
|
||||
self.with(|this| {
|
||||
let mut search = this.index.search(&this.txn);
|
||||
if let Some(query) = &search_query.q {
|
||||
search.query(query);
|
||||
}
|
||||
|
||||
if let Some(offset) = search_query.offset {
|
||||
search.offset(offset);
|
||||
}
|
||||
|
||||
let limit = search_query.limit;
|
||||
search.limit(limit);
|
||||
|
||||
Ok(search.execute()?)
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn fields_ids_map(&self) -> Result<FieldsIdsMap> {
|
||||
self.with(|this| Ok(this.index.fields_ids_map(&this.txn)?))
|
||||
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn displayed_fields_ids(&self) -> Result<Option<Vec<FieldId>>> {
|
||||
self.with(|this| Ok(this.index.displayed_fields_ids(&this.txn)?))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn displayed_fields(&self) -> Result<Option<Vec<String>>> {
|
||||
self.with(|this| Ok(this.index
|
||||
.displayed_fields(&this.txn)?
|
||||
.map(|fields| fields.into_iter().map(String::from).collect())))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn searchable_fields(&self) -> Result<Option<Vec<String>>> {
|
||||
self.with(|this| Ok(this.index
|
||||
.searchable_fields(&this.txn)?
|
||||
.map(|fields| fields.into_iter().map(String::from).collect())))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn faceted_fields(&self) -> Result<HashMap<std::string::String, FacetType>> {
|
||||
self.with(|this| Ok(this.index.faceted_fields(&this.txn)?))
|
||||
}
|
||||
|
||||
pub fn documents(&self, ids: &[u32]) -> Result<Vec<(u32, obkv::KvReader<'_>)>> {
|
||||
let txn = self.borrow_txn();
|
||||
let index = self.borrow_index();
|
||||
Ok(index.documents(txn, ids.into_iter().copied())?)
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue