[−][src]Struct sonic_channel::SearchChannel
The Sonic Channel Search mode is used for querying the search index. Once in this mode, you cannot switch to other modes or gain access to commands from other modes.
Available commands
In this mode you can use query
, suggest
, ping
and quit
commands.
Note: This mode requires enabling the search
feature.
Implementations
impl SearchChannel
[src]
pub fn quit(&self) -> Result<<QuitCommand as StreamCommand>::Response>
[src]
Stop connection.
let channel = SearchChannel::start( "localhost:1491", "SecretPassword", )?; channel.quit()?;
pub fn ping(&self) -> Result<<PingCommand as StreamCommand>::Response>
[src]
Ping server.
let channel = SearchChannel::start( "localhost:1491", "SecretPassword", )?; channel.ping()?;
impl SearchChannel
[src]
pub fn query<'a>(
&self,
collection: &'a str,
bucket: &'a str,
terms: &'a str
) -> Result<<QueryCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
terms: &'a str
) -> Result<<QueryCommand<'_> as StreamCommand>::Response>
Query objects in database.
Note: This method requires enabling the search
feature and start
connection in Search mode.
let search_channel = SearchChannel::start( "localhost:1491", "SecretPassword", )?; let result = search_channel.query("search", "default", "Beef")?; dbg!(result);
pub fn query_with_limit<'a>(
&self,
collection: &'a str,
bucket: &'a str,
terms: &'a str,
limit: usize
) -> Result<<QueryCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
terms: &'a str,
limit: usize
) -> Result<<QueryCommand<'_> as StreamCommand>::Response>
Query limited objects in database. This method similar query but you can configure limit of result.
Note: This method requires enabling the search
feature and start
connection in Search mode.
let search_channel = SearchChannel::start( "localhost:1491", "SecretPassword", )?; let result = search_channel.query_with_limit( "search", "default", "Beef", 10, )?; dbg!(result);
pub fn query_with_limit_and_offset<'a>(
&self,
collection: &'a str,
bucket: &'a str,
terms: &'a str,
limit: usize,
offset: usize
) -> Result<<QueryCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
terms: &'a str,
limit: usize,
offset: usize
) -> Result<<QueryCommand<'_> as StreamCommand>::Response>
Query limited objects in database. This method similar query_with_limit but you can put offset in your query.
Note: This method requires enabling the search
feature and start
connection in Search mode.
let search_channel = SearchChannel::start( "localhost:1491", "SecretPassword", )?; let result = search_channel.query_with_limit_and_offset( "search", "default", "Beef", 10, 10, )?; dbg!(result);
pub fn suggest<'a>(
&self,
collection: &'a str,
bucket: &'a str,
word: &'a str
) -> Result<<SuggestCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
word: &'a str
) -> Result<<SuggestCommand<'_> as StreamCommand>::Response>
Suggest auto-completes words.
Note: This method requires enabling the search
feature and start
connection in Search mode.
let search_channel = SearchChannel::start( "localhost:1491", "SecretPassword", )?; let result = search_channel.suggest("search", "default", "Beef")?; dbg!(result);
pub fn suggest_with_limit<'a>(
&self,
collection: &'a str,
bucket: &'a str,
word: &'a str,
limit: usize
) -> Result<<SuggestCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
word: &'a str,
limit: usize
) -> Result<<SuggestCommand<'_> as StreamCommand>::Response>
Suggest auto-completes words with limit.
Note: This method requires enabling the search
feature and start
connection in Search mode.
let search_channel = SearchChannel::start( "localhost:1491", "SecretPassword", )?; let result = search_channel.suggest_with_limit("search", "default", "Beef", 5)?; dbg!(result);
Trait Implementations
impl Debug for SearchChannel
[src]
impl SonicChannel for SearchChannel
[src]
type Channel = SearchChannel
Sonic channel struct
pub fn stream(&self) -> &SonicStream
[src]
pub fn start<A, S>(addr: A, password: S) -> Result<Self::Channel> where
A: ToSocketAddrs,
S: ToString,
[src]
A: ToSocketAddrs,
S: ToString,
Auto Trait Implementations
impl RefUnwindSafe for SearchChannel
impl Send for SearchChannel
impl Sync for SearchChannel
impl Unpin for SearchChannel
impl UnwindSafe for SearchChannel
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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.
pub 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>,