[−][src]Struct meilimelo::MeiliMelo
Descriptor to a MeiliSearch instance
Implementations
impl<'m> MeiliMelo<'m>
[src]
pub fn new(host: &str) -> MeiliMelo<'_>
[src]
Creates a new descriptor to a MeiliSearch instance
Arguments
host
- Scheme, hostname and port to the MeiliSearch instance
pub fn with_secret_key(self, key: &'m str) -> MeiliMelo<'m>
[src]
Adds the secret key to be used to authenticate against MeiliSearch
Arguments
key
- The string representation of the secret key
Examples
use meilimelo::prelude::*; let m = MeiliMelo::new("https://meilisearch.example.com:7700") .with_secret_key("abcdef");
pub fn search(&'m self, index: &'m str) -> Query<'_>
[src]
Initialize a search query
The returned struct implements the builder pattern and allows to
construct the query incrementally. Please see
Query
for details on the available methods.
Arguments
index
- The name of the index to search
pub async fn indices(&'m self) -> Result<Vec<Index>, Error>
[src]
List all available indices
Examples
let meili = MeiliMelo::new("host"); for index in meili.indices().await.unwrap() { println!("{}", index.name); }
pub async fn create_index<'a, '_, '_>(
&'m self,
uid: &'_ str,
name: &'_ str
) -> Result<Index, Error>
[src]
&'m self,
uid: &'_ str,
name: &'_ str
) -> Result<Index, Error>
Create a new index
Arguments
uid
- unique ID for the new indexname
- human-readable name for the index
Examples
MeiliMelo::new("host") .create_index("employees", "Employees") .await;
pub async fn delete_index<'_>(&'m self, uid: &'_ str) -> Result<(), Error>
[src]
Delete an existing index
Arguments
uid
- unique ID to the index to be deleted
Examples
MeiliMelo::new("host") .delete_index("employees") .await;
pub async fn insert<T, '_, '_>(
&'m self,
index: &'_ str,
documents: &'_ Vec<T>
) -> Result<Update, Error> where
T: Serialize,
[src]
&'m self,
index: &'_ str,
documents: &'_ Vec<T>
) -> Result<Update, Error> where
T: Serialize,
Index a collection of documents into MeiliSearch
Arguments
- index - Name of the index into which documents are to be inserted
- documents - Collection of
Serialize
-able structs to insert
Examples
let docs = vec![ Employee { firstname: "Luke".to_string(), lastname: "Skywalker".to_string() } ]; MeiliMelo::new("host") .insert("employees", &docs);
pub async fn list_documents<R, '_>(
&'m self,
index: &'_ str,
limit: i64,
offset: i64
) -> Result<Vec<R>, Error> where
R: Deserialize<'de>,
[src]
&'m self,
index: &'_ str,
limit: i64,
offset: i64
) -> Result<Vec<R>, Error> where
R: Deserialize<'de>,
List documents in order
Arguments
index
- name of the index to browselimit
- number of documents to returnoffset
- offset to the first document to return
Examples
let meili = MeiliMelo::new("host"); for document in &meili.list_documents::<Employee>("employees", 10, 0).await.unwrap() { println!("{} {}", document.firstname, document.lastname); }
pub async fn get_document<R, '_, '_>(
&'m self,
index: &'_ str,
uid: &'_ str
) -> Result<R, Error> where
R: Deserialize<'de>,
[src]
&'m self,
index: &'_ str,
uid: &'_ str
) -> Result<R, Error> where
R: Deserialize<'de>,
List documents in order
Arguments
index
- name of the index to browseuid
- Unique ID of the document to return
Examples
MeiliMelo::new("") .get_document::<Employee>("employees", "lskywalker") .await;
pub async fn delete_document<'_, '_>(
&'m self,
index: &'_ str,
uid: &'_ str
) -> Result<Update, Error>
[src]
&'m self,
index: &'_ str,
uid: &'_ str
) -> Result<Update, Error>
Trait Implementations
Auto Trait Implementations
impl<'m> RefUnwindSafe for MeiliMelo<'m>
impl<'m> Send for MeiliMelo<'m>
impl<'m> Sync for MeiliMelo<'m>
impl<'m> Unpin for MeiliMelo<'m>
impl<'m> UnwindSafe for MeiliMelo<'m>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,