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