Milvex.Ranker.DecayRanker (milvex v0.10.2)

Copy Markdown

Decay function reranker for hybrid search.

Applies a decay function (Gaussian, exponential, or linear) to a numeric field, scoring documents higher when the field value is closer to the origin. Useful for time-based relevance decay.

Fields

  • :function - Decay curve: :gauss, :exp, or :linear
  • :field - Name of the numeric field to apply decay to
  • :origin - Center point (e.g., a timestamp)
  • :scale - Distance from origin at which score equals :decay
  • :offset - Zone around origin with full score (default: 0)
  • :decay - Score at :scale distance from origin (default: 0.5)

Summary

Types

t()

@type t() :: %Milvex.Ranker.DecayRanker{
  decay: float(),
  field: String.t(),
  function: :gauss | :exp | :linear,
  offset: non_neg_integer(),
  origin: integer(),
  scale: pos_integer()
}