pub struct Query { /* private fields */ }Expand description
Examples
use os_query_builder_rs::full_text::multi_match::MultiMatch;
use os_query_builder_rs::misc::operator::Operator;
use os_query_builder_rs::misc::query_field::QueryField;
use os_query_builder_rs::misc::r#type::Type;
use os_query_builder_rs::model::Query;
let multi_match = MultiMatch::new()
.fields(vec!["brands", "articles"])
.value("oc47")
.operator(Operator::And)
.query_type(Type::BestFields)
.boost(2)
.minimum_should_match("90%");
let query = Query::new()
.source(vec!["test"])
.query(multi_match);Implementations§
Source§impl Query
impl Query
pub fn new() -> Self
pub fn source<F, T>(self, source: F) -> Self
pub fn query<T: Into<QueryField> + Serialize>(self, query: T) -> Self
pub fn from<T: Into<usize> + Serialize>(self, from: T) -> Self
pub fn size<T: Into<usize> + Serialize>(self, size: T) -> Self
pub fn aggs<T: Into<Value> + Serialize>(self, aggs: T) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnwindSafe for Query
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