Skip to content

Commit

Permalink
Fix score
Browse files Browse the repository at this point in the history
  • Loading branch information
fat-fellow committed Jul 11, 2024
1 parent 2cb2176 commit 56d8dd2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/c_util/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ pub fn search(
documents.push(Document {
tantivy_doc: doc,
highlights,
score: score as usize,
score: score,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ pub extern "C" fn document_create() -> *mut Document {
Box::into_raw(Box::new(Document {
tantivy_doc: TantivyDocument::new(),
highlights: vec![],
score: 0,
score: 0.0,
}))
}

Expand Down
2 changes: 1 addition & 1 deletion src/tantivy_util/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tantivy::TantivyDocument;
pub struct Document {
pub tantivy_doc: TantivyDocument,
pub highlights: Vec<Highlight>,
pub score: usize,
pub score: f32,
}

#[derive(Clone, Serialize)]
Expand Down

0 comments on commit 56d8dd2

Please sign in to comment.