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> {
|
||||
pub(crate) fn new(inner: &'a Index, ranked_map: RankedMap) -> DocumentsAddition<'a> {
|
||||
pub fn new(inner: &'a Index, ranked_map: RankedMap) -> DocumentsAddition<'a> {
|
||||
DocumentsAddition {
|
||||
inner,
|
||||
document_ids: HashSet::new(),
|
||||
|
@ -13,7 +13,7 @@ pub struct 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() }
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ use crate::document_attr_key::DocumentAttrKey;
|
||||
use crate::schema::SchemaAttr;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DocumentsIndex(pub(crate) Arc<sled::Tree>);
|
||||
pub struct DocumentsIndex(pub Arc<sled::Tree>);
|
||||
|
||||
impl DocumentsIndex {
|
||||
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};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Index(pub(crate) ArcSwap<InnerIndex>);
|
||||
pub struct Index(pub ArcSwap<InnerIndex>);
|
||||
|
||||
pub struct InnerIndex {
|
||||
pub words: fst::Set,
|
||||
@ -25,7 +25,7 @@ pub struct InnerIndex {
|
||||
}
|
||||
|
||||
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()? {
|
||||
Some(words) => words,
|
||||
None => fst::Set::default(),
|
||||
|
@ -6,7 +6,7 @@ use crate::schema::Schema;
|
||||
use super::Error;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct MainIndex(pub(crate) Arc<sled::Tree>);
|
||||
pub struct MainIndex(pub Arc<sled::Tree>);
|
||||
|
||||
impl MainIndex {
|
||||
pub fn schema(&self) -> Result<Option<Schema>, Error> {
|
||||
|
@ -5,7 +5,7 @@ use sdset::{Set, SetBuf};
|
||||
use zerocopy::{LayoutVerified, AsBytes};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct WordsIndex(pub(crate) Arc<sled::Tree>);
|
||||
pub struct WordsIndex(pub Arc<sled::Tree>);
|
||||
|
||||
impl WordsIndex {
|
||||
pub fn doc_indexes(&self, word: &[u8]) -> sled::Result<Option<SetBuf<DocIndex>>> {
|
||||
|
@ -134,12 +134,12 @@ impl Schema {
|
||||
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)?;
|
||||
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 attributes = self.attributes_ordered();
|
||||
let builder = SchemaBuilder { identifier, attributes };
|
||||
|
Loading…
x
Reference in New Issue
Block a user