BM25 ranked retrieval. Search the index produced by nlp_index_tokens with a keyword query. The unit-id column in results is taken from attr(index, "id_col") when present, else "uid".

search_index(index, query, n = 10, stem = FALSE)

Arguments

index

Object created by nlp_index_tokens.

query

Character string (keywords).

n

Number of results to return (default 10).

stem

Logical; must match the setting used during indexing (default FALSE).

Value

Data.table with columns query, method (“bm25”), score (3 significant figures), and the unit-id column (e.g. uid), ranked by score.