Struct re_dev_tools::build_search_index::meili::SearchClient
source · pub struct SearchClient {
url: String,
master_key: String,
agent: Agent,
}
Fields§
§url: String
§master_key: String
§agent: Agent
Implementations§
source§impl SearchClient
impl SearchClient
sourcepub fn connect(url: &str, master_key: &str) -> Result<Self>
pub fn connect(url: &str, master_key: &str) -> Result<Self>
Connect to Meilisearch.
master_key
can be obtained via the Meilisearch could console,
or set via the --master-key
option when running a local instance.
sourcepub fn index(&self, index: &str, documents: &[Document]) -> Result<()>
pub fn index(&self, index: &str, documents: &[Document]) -> Result<()>
Create an index from documents
.
If an index with the same name already exists, it is deleted first.
sourcepub fn query(
&self,
index: &str,
q: &str,
limit: Option<usize>,
) -> Result<Vec<Document>>
pub fn query( &self, index: &str, q: &str, limit: Option<usize>, ) -> Result<Vec<Document>>
Query a specific index in the database.
fn index_exists(&self, index: &str) -> Result<bool>
fn create_index(&self, index: &str) -> Result<()>
fn add_or_replace_documents( &self, index: &str, documents: &[Document], ) -> Result<()>
fn delete_index(&self, index: &str) -> Result<()>
fn wait_for_task(&self, task: Task) -> Result<()>
fn check_master_key(&self) -> Result<()>
fn request(&self, method: Method, path: &str) -> Request
fn request_with_url(&self, method: Method, url: &Url) -> Request
Auto Trait Implementations§
impl Freeze for SearchClient
impl !RefUnwindSafe for SearchClient
impl Send for SearchClient
impl Sync for SearchClient
impl Unpin for SearchClient
impl !UnwindSafe for SearchClient
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more