pub struct Ranker { /* private fields */ }Expand description
The rules, with how a title is compared to the query: the server
compares as Plex sorts (normalized); the SDK with no server folds
accents and punctuation as well, as it matches.
Implementations§
Source§impl Ranker
impl Ranker
Sourcepub fn new(normalize: fn(&str) -> String) -> Self
pub fn new(normalize: fn(&str) -> String) -> Self
Titles and the query compared after normalize, which drops a
leading article as normalized does.
Sourcepub fn group(
&self,
request: &SearchRequest,
query: &Parsed,
found: Vec<Matched>,
totals: &HashMap<SearchKind, u32>,
without_year: Vec<Item>,
copies: &HashMap<MediaId, Vec<MediaId>>,
) -> SearchResults
pub fn group( &self, request: &SearchRequest, query: &Parsed, found: Vec<Matched>, totals: &HashMap<SearchKind, u32>, without_year: Vec<Item>, copies: &HashMap<MediaId, Vec<MediaId>>, ) -> SearchResults
What a client is shown of found, the matches for query (its
text and the year taken off it). totals has each kind’s count,
the other scopes’ too when they were counted. In All, an episode
whose show is listed in the shows group (or any of that show’s
other copies, copies) is quiet: counted in hidden, not listed.
One whose show is the top match is listed. A group with no item is
left out, but for a “See all”.
Sourcepub fn without_year(
&self,
text: &str,
year: u16,
found: &[Matched],
any_year: Vec<Matched>,
) -> Vec<Item>
pub fn without_year( &self, text: &str, year: u16, found: &[Matched], any_year: Vec<Matched>, ) -> Vec<Item>
Up to WITHOUT_YEAR of any_year that are not of year and not
already found, best first.