Struct imdb_index::Query[][src]

pub struct Query { /* fields omitted */ }

A query that can be used to search IMDb media records.

A query typically consists of a fuzzy name query along with zero or more filters. If a query lacks a fuzzy name query, then this will generally result in an exhaustive search of all IMDb media records, which can be slow.

Filters are matched conjunctively. That is, a search result must satisfy every filter on a query to match.

Empty queries always return no results.

The Serialize and Deserialize implementations for this type use the free-form query syntax.

Methods

impl Query
[src]

Create a new empty query.

Return true if and only if this query is empty.

Searching with an empty query always yields no results.

Set the name to query by.

The name given here is normalized and broken down into components automatically to facilitate fuzzy searching.

Note that if no name is provided in a query, then it is possible that searching with the query will require exhaustively looking at every record in IMDb. This will be slower.

Set the scorer to use for name searches.

The name scorer is used to rank results from searching the IMDb name index. If no name query is given, then this scorer is not used.

If None is provided here, then the name index will not be used. This will likely cause an exhaustive search of all IMDb records, which can be slow. The use case for providing a name query without a name scorer is if you, for example, wanted to rank all of the records in IMDb by the Levenshtein distance between your query and every other record in IMDb. Normally, when the name index is used, only the (small number) of results returned by searching the name are ranked. Typically, these sorts of queries are useful for evaluation purposes, but not much else.

Set the similarity function.

The similarity function can be selected from a predefined set of choices defined by the Similarity type.

When a similarity function is used, then any results from searching the name index are re-ranked according to their similarity with the query.

By default, no similarity function is used.

Set the maximum number of results to be returned by a search.

Note that setting this number too high (e.g., > 10,000) can impact performance. This is a normal restriction found in most information retrieval systems. That is, deep paging through result sets is expensive.

Add a title kind to filter by.

Multiple title kinds can be added to query, and search results must match at least one of them.

Note that it is not possible to remove title kinds from an existing query. Instead, build a new query from scratch.

Set the lower inclusive bound on a title's year.

This applies to either the title's start or end years.

Set the upper inclusive bound on a title's year.

This applies to either the title's start or end years.

Set the lower inclusive bound on a title's number of votes.

Set the upper inclusive bound on a title's number of votes.

Set the lower inclusive bound on a title's season.

This automatically limits all results to episodes.

Set the upper inclusive bound on a title's season.

This automatically limits all results to episodes.

Set the lower inclusive bound on a title's episode number.

This automatically limits all results to episodes.

Set the upper inclusive bound on a title's episode number.

This automatically limits all results to episodes.

Restrict results to episodes belonging to the TV show given by its IMDb ID.

This automatically limits all results to episodes.

Trait Implementations

impl Clone for Query
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Query
[src]

Formats the value using the given formatter. Read more

impl Eq for Query
[src]

impl Hash for Query
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Query
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for Query
[src]

Returns the "default value" for a type. Read more

impl Serialize for Query
[src]

Serialize this value into the given Serde serializer. Read more

impl<'a> Deserialize<'a> for Query
[src]

Deserialize this value from the given Serde deserializer. Read more

impl FromStr for Query
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Display for Query
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Query

impl Sync for Query