[−][src]Struct sonic_channel::IngestChannel
The Sonic Channel Ingest mode is used for altering the search index (push, pop and flush). 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 push
, pop
, flushc
, flushb
, flusho
,
bucket_count
, object_count
, word_count
, ping
and quit
commands.
Note: This mode requires enabling the ingest
feature.
Implementations
impl IngestChannel
[src]
pub fn quit(&self) -> Result<<QuitCommand as StreamCommand>::Response>
[src]
Stop connection.
let channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; channel.quit()?;
pub fn ping(&self) -> Result<<PingCommand as StreamCommand>::Response>
[src]
Ping server.
let channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; channel.ping()?;
impl IngestChannel
[src]
pub fn push<'a>(
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str,
text: &'a str
) -> Result<<PushCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str,
text: &'a str
) -> Result<<PushCommand<'_> as StreamCommand>::Response>
Push search data in the index.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let result = ingest_channel.push( "search", "default", "recipe:295", "Sweet Teriyaki Beef Skewers", )?; assert_eq!(result, true);
pub fn push_with_locale<'a>(
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str,
text: &'a str,
locale: &'a str
) -> Result<<PushCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str,
text: &'a str,
locale: &'a str
) -> Result<<PushCommand<'_> as StreamCommand>::Response>
Push search data in the index with locale parameter in ISO 639-3 code.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let result = ingest_channel.push_with_locale( "search", "default", "recipe:296", "Гренки с жареным картофелем и сыром", "rus", )?; assert_eq!(result, true);
pub fn pop<'a>(
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str,
text: &'a str
) -> Result<<PopCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str,
text: &'a str
) -> Result<<PopCommand<'_> as StreamCommand>::Response>
Pop search data from the index. Returns removed words count as usize type.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let result = ingest_channel.pop("search", "default", "recipe:295", "beef")?; assert_eq!(result, 1);
pub fn flushc<'a>(
&self,
collection: &'a str
) -> Result<<FlushCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str
) -> Result<<FlushCommand<'_> as StreamCommand>::Response>
Flush all indexed data from collections.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let flushc_count = ingest_channel.flushc("search")?; dbg!(flushc_count);
pub fn flushb<'a>(
&self,
collection: &'a str,
bucket: &'a str
) -> Result<<FlushCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str
) -> Result<<FlushCommand<'_> as StreamCommand>::Response>
Flush all indexed data from bucket in a collection.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let flushb_count = ingest_channel.flushb("search", "default")?; dbg!(flushb_count);
pub fn flusho<'a>(
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str
) -> Result<<FlushCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str
) -> Result<<FlushCommand<'_> as StreamCommand>::Response>
Flush all indexed data from an object in a bucket in collection.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let flusho_count = ingest_channel.flusho("search", "default", "recipe:296")?; dbg!(flusho_count);
pub fn bucket_count<'a>(
&self,
collection: &'a str
) -> Result<<CountCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str
) -> Result<<CountCommand<'_> as StreamCommand>::Response>
Bucket count in indexed search data of your collection.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let bucket_count = ingest_channel.bucket_count("search")?; dbg!(bucket_count);
pub fn object_count<'a>(
&self,
collection: &'a str,
bucket: &'a str
) -> Result<<CountCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str
) -> Result<<CountCommand<'_> as StreamCommand>::Response>
Object count of bucket in indexed search data.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let object_count = ingest_channel.object_count("search", "default")?; dbg!(object_count);
pub fn word_count<'a>(
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str
) -> Result<<CountCommand<'_> as StreamCommand>::Response>
[src]
&self,
collection: &'a str,
bucket: &'a str,
object: &'a str
) -> Result<<CountCommand<'_> as StreamCommand>::Response>
Object word count in indexed bucket search data.
Note: This method requires enabling the ingest
feature and start
connection in Ingest mode.
let ingest_channel = IngestChannel::start( "localhost:1491", "SecretPassword", )?; let word_count = ingest_channel.word_count("search", "default", "recipe:296")?; dbg!(word_count);
Trait Implementations
impl Debug for IngestChannel
[src]
impl SonicChannel for IngestChannel
[src]
type Channel = IngestChannel
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 IngestChannel
impl Send for IngestChannel
impl Sync for IngestChannel
impl Unpin for IngestChannel
impl UnwindSafe for IngestChannel
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>,