imdb_index/lib.rs
1/*!
2This crate provides an on-disk indexing data structure for searching IMDb.
3Searching is primarily done using information retrieval techniques, which
4support fuzzy name queries and using TF-IDF-like ranking functions.
5*/
6
7#![deny(missing_docs)]
8
9pub use crate::error::{Error, ErrorKind, Result};
10pub use crate::index::{
11 AKARecordIter, Index, IndexBuilder, MediaEntity, NameQuery, NameScorer,
12 NgramType,
13};
14pub use crate::record::{Episode, Rating, Title, TitleKind, AKA};
15pub use crate::scored::{Scored, SearchResults};
16pub use crate::search::{Query, Searcher, Similarity};
17
18// A macro that creates an error that represents a bug.
19//
20// This is typically used when reading index structures from disk. Since the
21// data on disk is generally outside our control, we return an error using this
22// macro instead of panicking (or worse, silently misinterpreting data).
23macro_rules! bug {
24 ($($tt:tt)*) => {{
25 return Err($crate::error::Error::bug(format!($($tt)*)));
26 }}
27}
28
29mod error;
30mod index;
31mod record;
32mod scored;
33mod search;
34mod util;