parent
8df8edeeca
commit
a21fd44f64
1 changed files with 4 additions and 4 deletions
|
@ -29,8 +29,8 @@ pub struct DocEmbedding {
|
|||
}
|
||||
|
||||
impl DocEmbedding {
|
||||
pub async fn total_chunks(&self) -> i64 {
|
||||
let res: (i64,) = sqlx::query_as(
|
||||
pub async fn total_chunks(&self) -> i32 {
|
||||
let res: (i32,) = sqlx::query_as(
|
||||
"SELECT MAX(chunk) FROM doc_embedding WHERE domain = $1 AND path = $2 AND ver = $3",
|
||||
)
|
||||
.bind(&self.domain)
|
||||
|
@ -48,12 +48,12 @@ impl DocEmbedding {
|
|||
pub struct SearchResult {
|
||||
pub domain: String,
|
||||
pub path: String,
|
||||
pub total_chunks: i64,
|
||||
pub total_chunks: i32,
|
||||
pub chunks: Vec<DocEmbedding>,
|
||||
}
|
||||
|
||||
impl SearchResult {
|
||||
pub fn new(domain: String, path: String, total_chunks: i64) -> Self {
|
||||
pub fn new(domain: String, path: String, total_chunks: i32) -> Self {
|
||||
Self {
|
||||
domain,
|
||||
path,
|
||||
|
|
Loading…
Add table
Reference in a new issue