struct

Engram::SearchResult

Inherits JSON::Serializable < Struct < Value < Object

A single ranked result from Search#search or Search#recent.

score is only meaningful within one call, and its ordering convention depends on how the call was answered: plain bm25+recency results carry a score that sorts ascending (lower is better — the FTS5 bm25 convention, nudged by the recency boost), while results blended with embeddings via Reciprocal Rank Fusion carry an RRF score that sorts descending (higher is better). Search always returns results already in the right order for whichever path produced them — score is exposed for transparency and --json output, not for the caller to re-sort by.

Constructors

new(id : Int64, title : String, topics : Array(String), snippet : String, score : Float64)

Builds a search result from already-computed fields.

Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

score
Source
snippet
Source
title
Source
topics
Source