content_indexer v0.2.0 ContentIndexer.Index

struct to store the details of what data is held in the index It provides a new/2 function for instantiating the struct that includes a generated UUID

Link to this section Summary

Functions

Instantiates a new Index struct

Link to this section Functions

Link to this function new(file_name, tokens)

Instantiates a new Index struct

## Parameters

- file_name: String that represents the file that has the content to be indexed
- tokens: List of Strings that are the tokenised content

## Example

iex> ContentIndexer.Index.new("test_file.md", ["bread", "butter", "jam", "mustard"])
%ContentIndexer.Index{file_name: "test_file.md", term_weights: %{}, tokens: ["bread", "butter", "jam", "mustard"], uuid: "e080d012-f89b-434c-964f-ddad9b8c2e20"}