pub struct QueryParams {
pub filters: HashMap<String, Value>,
pub ranges: HashMap<String, HashMap<String, Value>>,
pub matches: HashMap<String, String>,
pub sort: Vec<HashMap<String, Value>>,
pub from: Option<usize>,
pub size: Option<usize>,
}Expand description
Query parameters for filtering documents
Fields§
§filters: HashMap<String, Value>Simple field-value filters (term queries)
ranges: HashMap<String, HashMap<String, Value>>Range queries (e.g., {“age”: {“gte”: 18, “lte”: 65}})
matches: HashMap<String, String>Match queries for text search
sort: Vec<HashMap<String, Value>>Sort parameters
from: Option<usize>Pagination
size: Option<usize>Implementations§
Source§impl QueryParams
impl QueryParams
pub fn new() -> Self
Sourcepub fn match_query(self, field: &str, value: &str) -> Self
pub fn match_query(self, field: &str, value: &str) -> Self
Add a match query
Sourcepub fn to_es_query(&self) -> Value
pub fn to_es_query(&self) -> Value
Convert to Elasticsearch query DSL
Sourcepub fn to_search_body(&self) -> Value
pub fn to_search_body(&self) -> Value
Convert to full search body
Trait Implementations§
Source§impl Clone for QueryParams
impl Clone for QueryParams
Source§fn clone(&self) -> QueryParams
fn clone(&self) -> QueryParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryParams
impl Debug for QueryParams
Auto Trait Implementations§
impl Freeze for QueryParams
impl RefUnwindSafe for QueryParams
impl Send for QueryParams
impl Sync for QueryParams
impl Unpin for QueryParams
impl UnwindSafe for QueryParams
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