Recollect.Search.ContextBooster (recollect v0.5.1)

Copy Markdown View Source

Calculate context boost for search results based on entry hints matching current context.

Summary

Functions

Apply context boost to a list of search results.

Calculate context boost for an entry given its context hints and current context.

Calculate boost with custom parameters.

Functions

apply_boost(results, current_context)

Apply context boost to a list of search results.

boost(entry_hints, current_context)

Calculate context boost for an entry given its context hints and current context.

Parameters

  • entry_hints - Map of context hints from the entry (e.g., %{repo: "owner/repo", os: "linux"})
  • current_context - Map of currently detected context

Returns

A float between 0.0 and @max_boost representing the boost to add to the score.

boost(entry_hints, current_context, opts)

Calculate boost with custom parameters.