2021-12-24 17:15:51 +03:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
pub use sonic_channel::*;
|
|
|
|
|
|
|
|
pub const HOST: &str = "localhost:36999";
|
|
|
|
pub const PASS: &str = "SecretPassword1234";
|
|
|
|
|
|
|
|
pub fn ingest_start() -> IngestChannel {
|
|
|
|
IngestChannel::start(HOST, PASS).expect("The Sonic server must be running")
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn search_start() -> SearchChannel {
|
|
|
|
SearchChannel::start(HOST, PASS).expect("The Sonic server must be running")
|
|
|
|
}
|
|
|
|
|
2021-12-25 00:11:34 +03:00
|
|
|
pub fn control_start() -> ControlChannel {
|
|
|
|
ControlChannel::start(HOST, PASS).expect("The Sonic server must be running")
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn consolidate() {
|
|
|
|
control_start().consolidate().unwrap();
|
|
|
|
}
|
|
|
|
|
2021-12-24 23:43:47 +03:00
|
|
|
pub fn flush_bucket(collection: &str, bucket: &str) {
|
2022-07-18 14:07:12 +03:00
|
|
|
ingest_start()
|
|
|
|
.flush(FlushRequest::bucket(collection, bucket))
|
|
|
|
.unwrap();
|
2021-12-24 17:15:51 +03:00
|
|
|
}
|