barrel_ngram_corpus (barrel_ngram v0.7.1)

View Source

Corpus text extraction.

The single definition of "the bytes that represent a document" for a corpus. Both the indexer (which selects grams from these bytes) and the query confirm pass (which runs the real substring match on them) call doc_text/2, so the index and the confirm can never disagree about what a document contains.

M1 indexes the binary string values of a document's non-reserved top-level fields, sorted by field name and joined by a newline. The fields config narrows this to a named subset. Non-binary values (numbers, nested maps, lists) are skipped.

Summary

Functions

The indexed byte string for a document under a corpus config.

Functions

doc_text(Doc, Config)

-spec doc_text(map(), map()) -> binary().

The indexed byte string for a document under a corpus config.