Struct elasticsearch_dsl::search::queries::term_level::TermsLookupQuery
source · pub struct TermsLookupQuery { /* private fields */ }Expand description
Terms lookup fetches the field values of an existing document. Elasticsearch then uses those values as search terms. This can be helpful when searching for a large set of terms.
Because terms lookup fetches values from a document, the
_source
mapping field must be enabled to use terms lookup. The _source
field is enabled by default.
By default, Elasticsearch limits the
termsquery to a maximum of 65,536 terms. This includes terms fetched using terms lookup. You can change this limit using theindex.max_terms_count setting.
To create a terms lookup query:
Query::terms_lookup("test", "index", "id", "path")
.routing("routing")
.boost(1.3)
.name("lookup");https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html
Implementations§
source§impl TermsLookupQuery
impl TermsLookupQuery
pub fn serialize<__S>(
__self: &TermsLookupQuery,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
source§impl TermsLookupQuery
impl TermsLookupQuery
sourcepub fn boost<T>(self, boost: T) -> Selfwhere
T: AsPrimitive<f32>,
pub fn boost<T>(self, boost: T) -> Selfwhere
T: AsPrimitive<f32>,
Floating point number used to decrease or increase the
relevance scores
of a query. Defaults to 1.0.
You can use the boost parameter to adjust relevance scores for searches containing two or more queries.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
source§impl TermsLookupQuery
impl TermsLookupQuery
sourcepub fn routing<S>(self, routing: S) -> Selfwhere
S: ToString,
pub fn routing<S>(self, routing: S) -> Selfwhere
S: ToString,
Custom routing value of the document from which to fetch term values. If a custom routing value was provided when the document was indexed, this parameter is required.
Trait Implementations§
source§impl Clone for TermsLookupQuery
impl Clone for TermsLookupQuery
source§fn clone(&self) -> TermsLookupQuery
fn clone(&self) -> TermsLookupQuery
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TermsLookupQuery
impl Debug for TermsLookupQuery
source§impl From<TermsLookupQuery> for Option<Query>
impl From<TermsLookupQuery> for Option<Query>
source§fn from(q: TermsLookupQuery) -> Self
fn from(q: TermsLookupQuery) -> Self
source§impl From<TermsLookupQuery> for Query
impl From<TermsLookupQuery> for Query
source§fn from(q: TermsLookupQuery) -> Self
fn from(q: TermsLookupQuery) -> Self
source§impl IntoIterator for TermsLookupQuery
impl IntoIterator for TermsLookupQuery
§type Item = TermsLookupQuery
type Item = TermsLookupQuery
§type IntoIter = IntoIter<<TermsLookupQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<TermsLookupQuery as IntoIterator>::Item>
source§impl PartialEq<Query> for TermsLookupQuery
impl PartialEq<Query> for TermsLookupQuery
source§impl PartialEq<TermsLookupQuery> for Query
impl PartialEq<TermsLookupQuery> for Query
source§impl PartialEq for TermsLookupQuery
impl PartialEq for TermsLookupQuery
source§impl Serialize for TermsLookupQuery
impl Serialize for TermsLookupQuery
impl StructuralPartialEq for TermsLookupQuery
Auto Trait Implementations§
impl Freeze for TermsLookupQuery
impl RefUnwindSafe for TermsLookupQuery
impl Send for TermsLookupQuery
impl Sync for TermsLookupQuery
impl Unpin for TermsLookupQuery
impl UnwindSafe for TermsLookupQuery
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)