Struct elastiql::search::query::TermQuery[][src]

pub struct TermQuery {
    pub field: String,
    pub value: String,
    pub boost: Option<f64>,
}
Expand description

A Term query returns documents that contain an exact term in a provided field.

Fields

field: String

The name of the field to query.

value: String

A list of terms you wish to find in the provided field. To return a document, one or more terms must exactly match a field value, including whitespace and capitalization.

Although this field is a String, it will match numerical fields; e.g. "1.2" will match fields containing the floating point value 1.2.

boost: Option<f64>

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.

Implementations

Create a builder for building TermQuery. On the builder, call .field(...), .value(...), .boost(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of TermQuery.

Constructs a new TermQuery.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.