Skip to main content

Module search

Module search 

Source
Expand description

Full-text ranking without a model: the same query over the same memories always gives the same order.

Text is split into words (runs of letters and digits, lowercased). A query word hits a memory word that equals it (2 points) or starts with it (1 point), weighted by where the word is: title 4, description 2, text and links 1. A memory that hits more distinct query words always ranks above one that hits fewer; then more points; then the newer; then the id.

Functionsยง

rank
The best limit of items for query, each with its score. An empty query keeps every item, newest first, without scores.
score
The score of m for the query words, or 0 when none hits.
words
Lowercased words of text.