Skip to content

Instantly share code, notes, and snippets.

@jorendorff
Last active July 14, 2016 17:45
Show Gist options
  • Select an option

  • Save jorendorff/ffe86749f96103ed5163131d617eba3f to your computer and use it in GitHub Desktop.

Select an option

Save jorendorff/ffe86749f96103ed5163131d617eba3f to your computer and use it in GitHub Desktop.
// "Term" means word.
// Note: The hits in each Vec<Hit> are sorted by document_id.
type TermIndex = HashMap<String, SortedVec<Hit>>;
struct Hit {
/// Index into a single giant list of all the documents in the corpus
document_id: u32,
/// List of all the places within this document where the term appears.
offsets: SortedVec<u32>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment