mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-24 04:07:30 +01:00
chore: Replace crate only public interface to be completely public
This commit is contained in:
parent
2e31bb519a
commit
c5ba34d0b0
@ -20,7 +20,7 @@ pub struct DocumentsAddition<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> DocumentsAddition<'a> {
|
impl<'a> DocumentsAddition<'a> {
|
||||||
pub(crate) fn new(inner: &'a Index, ranked_map: RankedMap) -> DocumentsAddition<'a> {
|
pub fn new(inner: &'a Index, ranked_map: RankedMap) -> DocumentsAddition<'a> {
|
||||||
DocumentsAddition {
|
DocumentsAddition {
|
||||||
inner,
|
inner,
|
||||||
document_ids: HashSet::new(),
|
document_ids: HashSet::new(),
|
||||||
|
@ -13,7 +13,7 @@ pub struct DocumentsDeletion<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> DocumentsDeletion<'a> {
|
impl<'a> DocumentsDeletion<'a> {
|
||||||
pub(crate) fn new(inner: &'a Index) -> DocumentsDeletion {
|
pub fn new(inner: &'a Index) -> DocumentsDeletion {
|
||||||
DocumentsDeletion { inner, documents: Vec::new() }
|
DocumentsDeletion { inner, documents: Vec::new() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ use crate::document_attr_key::DocumentAttrKey;
|
|||||||
use crate::schema::SchemaAttr;
|
use crate::schema::SchemaAttr;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct DocumentsIndex(pub(crate) Arc<sled::Tree>);
|
pub struct DocumentsIndex(pub Arc<sled::Tree>);
|
||||||
|
|
||||||
impl DocumentsIndex {
|
impl DocumentsIndex {
|
||||||
pub fn document_field(&self, id: DocumentId, attr: SchemaAttr) -> sled::Result<Option<IVec>> {
|
pub fn document_field(&self, id: DocumentId, attr: SchemaAttr) -> sled::Result<Option<IVec>> {
|
||||||
|
@ -15,7 +15,7 @@ use crate::serde::Deserializer;
|
|||||||
use super::{Error, RawIndex, DocumentsAddition, DocumentsDeletion};
|
use super::{Error, RawIndex, DocumentsAddition, DocumentsDeletion};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Index(pub(crate) ArcSwap<InnerIndex>);
|
pub struct Index(pub ArcSwap<InnerIndex>);
|
||||||
|
|
||||||
pub struct InnerIndex {
|
pub struct InnerIndex {
|
||||||
pub words: fst::Set,
|
pub words: fst::Set,
|
||||||
@ -25,7 +25,7 @@ pub struct InnerIndex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Index {
|
impl Index {
|
||||||
pub(crate) fn from_raw(raw: RawIndex) -> Result<Index, Error> {
|
pub fn from_raw(raw: RawIndex) -> Result<Index, Error> {
|
||||||
let words = match raw.main.words_set()? {
|
let words = match raw.main.words_set()? {
|
||||||
Some(words) => words,
|
Some(words) => words,
|
||||||
None => fst::Set::default(),
|
None => fst::Set::default(),
|
||||||
|
@ -6,7 +6,7 @@ use crate::schema::Schema;
|
|||||||
use super::Error;
|
use super::Error;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct MainIndex(pub(crate) Arc<sled::Tree>);
|
pub struct MainIndex(pub Arc<sled::Tree>);
|
||||||
|
|
||||||
impl MainIndex {
|
impl MainIndex {
|
||||||
pub fn schema(&self) -> Result<Option<Schema>, Error> {
|
pub fn schema(&self) -> Result<Option<Schema>, Error> {
|
||||||
|
@ -5,7 +5,7 @@ use sdset::{Set, SetBuf};
|
|||||||
use zerocopy::{LayoutVerified, AsBytes};
|
use zerocopy::{LayoutVerified, AsBytes};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct WordsIndex(pub(crate) Arc<sled::Tree>);
|
pub struct WordsIndex(pub Arc<sled::Tree>);
|
||||||
|
|
||||||
impl WordsIndex {
|
impl WordsIndex {
|
||||||
pub fn doc_indexes(&self, word: &[u8]) -> sled::Result<Option<SetBuf<DocIndex>>> {
|
pub fn doc_indexes(&self, word: &[u8]) -> sled::Result<Option<SetBuf<DocIndex>>> {
|
||||||
|
@ -134,12 +134,12 @@ impl Schema {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn read_from_bin<R: Read>(reader: R) -> bincode::Result<Schema> {
|
pub fn read_from_bin<R: Read>(reader: R) -> bincode::Result<Schema> {
|
||||||
let builder: SchemaBuilder = bincode::deserialize_from(reader)?;
|
let builder: SchemaBuilder = bincode::deserialize_from(reader)?;
|
||||||
Ok(builder.build())
|
Ok(builder.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn write_to_bin<W: Write>(&self, writer: W) -> bincode::Result<()> {
|
pub fn write_to_bin<W: Write>(&self, writer: W) -> bincode::Result<()> {
|
||||||
let identifier = self.inner.identifier.clone();
|
let identifier = self.inner.identifier.clone();
|
||||||
let attributes = self.attributes_ordered();
|
let attributes = self.attributes_ordered();
|
||||||
let builder = SchemaBuilder { identifier, attributes };
|
let builder = SchemaBuilder { identifier, attributes };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user