mirror of
https://github.com/modrinth/code.git
synced 2026-08-27 01:54:47 +00:00
fix: search indexing performance and batching (#6521)
* Add consume batching delay * maybe fix * max batch size * more logging * parallelize remove tasks * delete/upsert project/version messages * prepare * more logging * log number of docs * try more targeted, homogenous version change ops * ensure only necessary fields are serialized into typesense * disable index background task * wip: script changes * don't facet by project id * fix * fix clippy * batch by document and dedup loaders * fix test * wip: projects/versions collections * clean up SearchBackend interface * cleanup pass * cleanup pass 2 * standardise fn names * cleanup pass * fix compile * factor out filter rewriting * query perf * put categories into the project doc * wip: search filter AST * doc comment * more AST normalization * (temp) convert search request errors into internal errors * implement unary NOT * tombi fmt * fix tests * revert request error * try increase stack size
This commit is contained in:
@@ -18,7 +18,7 @@ use crate::util::anrok;
|
||||
use actix_web::web;
|
||||
use clap::ValueEnum;
|
||||
use eyre::WrapErr;
|
||||
use tracing::info;
|
||||
use tracing::{info, instrument};
|
||||
use xredis::RedisPool;
|
||||
|
||||
#[derive(ValueEnum, Debug, Copy, Clone, PartialEq, Eq)]
|
||||
@@ -50,6 +50,7 @@ pub enum BackgroundTask {
|
||||
|
||||
impl BackgroundTask {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[instrument(skip_all, fields(background_task = ?self))]
|
||||
pub async fn run(
|
||||
self,
|
||||
pool: PgPool,
|
||||
@@ -176,7 +177,7 @@ pub async fn index_search(
|
||||
search_backend: web::Data<dyn SearchBackend>,
|
||||
) -> eyre::Result<()> {
|
||||
info!("Indexing local database");
|
||||
search_backend.index_projects(ro_pool, redis_pool).await
|
||||
search_backend.rebuild_index(ro_pool, redis_pool).await
|
||||
}
|
||||
|
||||
pub async fn release_scheduled(pool: PgPool) -> eyre::Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user