Skip to main content

uqa_core/
scored_entry.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Document identity and score produced by a retrieval operator.
8
9use crate::{DocId, PostingEntry};
10
11#[derive(Debug, Clone)]
12pub struct ScoredEntry {
13    pub doc_id: DocId,
14    pub score: f64,
15}
16
17impl ScoredEntry {
18    pub fn from_entry(e: &PostingEntry) -> Self {
19        Self {
20            doc_id: e.doc_id,
21            score: e.payload.score,
22        }
23    }
24}