aarondb/index/bm25

Types

pub type BM25Index {
  BM25Index(
    term_freq: dict.Dict(String, dict.Dict(fact.EntityId, Int)),
    doc_freq: dict.Dict(String, Int),
    doc_len: dict.Dict(fact.EntityId, Int),
    avg_doc_len: Float,
    doc_count: Int,
    attribute: String,
  )
}

Constructors

Values

pub fn add(
  index: BM25Index,
  entity: fact.EntityId,
  text: String,
) -> BM25Index
pub fn build(
  datoms: List(fact.Datom),
  attribute: String,
) -> BM25Index
pub fn empty(attribute: String) -> BM25Index
pub fn remove(
  index: BM25Index,
  entity: fact.EntityId,
  text: String,
) -> BM25Index
pub fn score(
  index: BM25Index,
  entity: fact.EntityId,
  query: String,
  k1: Float,
  b: Float,
) -> Float
Search Document