server: don't touch tantivy if no uids reindexed
This commit is contained in:
parent
da636ca1f3
commit
6c9ef912e6
@ -4,7 +4,7 @@ use log::{debug, error, info};
|
|||||||
use sqlx::{postgres::PgPool, types::time::PrimitiveDateTime};
|
use sqlx::{postgres::PgPool, types::time::PrimitiveDateTime};
|
||||||
use tantivy::{
|
use tantivy::{
|
||||||
collector::{DocSetCollector, TopDocs},
|
collector::{DocSetCollector, TopDocs},
|
||||||
query,
|
doc, query,
|
||||||
query::{AllQuery, BooleanQuery, Occur, QueryParser, TermQuery},
|
query::{AllQuery, BooleanQuery, Occur, QueryParser, TermQuery},
|
||||||
schema::{Facet, IndexRecordOption, Value},
|
schema::{Facet, IndexRecordOption, Value},
|
||||||
DocAddress, Index, Searcher, TantivyDocument, TantivyError, Term,
|
DocAddress, Index, Searcher, TantivyDocument, TantivyError, Term,
|
||||||
@ -102,8 +102,10 @@ impl TantivyConnection {
|
|||||||
self.reindex_uids(pool, &uids).await
|
self.reindex_uids(pool, &uids).await
|
||||||
}
|
}
|
||||||
async fn reindex_uids(&self, pool: &PgPool, uids: &[String]) -> Result<(), ServerError> {
|
async fn reindex_uids(&self, pool: &PgPool, uids: &[String]) -> Result<(), ServerError> {
|
||||||
|
if uids.is_empty() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
// TODO: add SlurpContents and convert HTML to text
|
// TODO: add SlurpContents and convert HTML to text
|
||||||
use tantivy::{doc, Term};
|
|
||||||
|
|
||||||
let start_time = std::time::Instant::now();
|
let start_time = std::time::Instant::now();
|
||||||
let pool: &PgPool = pool;
|
let pool: &PgPool = pool;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user