feat: add indexer time window setting (default 7 days) (#8290)

* feat: add indexer time window setting (default 7 days)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add time window note to search UIs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: fetch indexer time window from API in search UIs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update ee-repo-ref to 9df755c57fbfc88f4a724e1ea51b1d5f5af4fe52

This commit updates the EE repository reference after PR #447 was merged in windmill-ee-private.

Previous ee-repo-ref: c17f16bf45091272974e3aa8009cdf5cc15669bf

New ee-repo-ref: 9df755c57fbfc88f4a724e1ea51b1d5f5af4fe52

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
This commit is contained in:
Ruben Fiszel
2026-03-10 05:22:12 +00:00
committed by GitHub
parent 1e2413f02b
commit 718406537f
7 changed files with 59 additions and 4 deletions

View File

@@ -1 +1 @@
716b350bce1730b302c66ea69df618fa40f2f16b
9df755c57fbfc88f4a724e1ea51b1d5f5af4fe52

View File

@@ -16876,6 +16876,9 @@ paths:
lost_lock_ownership:
description: Is the current indexer service being replaced
type: boolean
max_index_time_window_secs:
description: Maximum time window in seconds for indexing
type: number
/srch/index/search/service_logs:
get:

View File

@@ -13,6 +13,7 @@ pub struct TantivyIndexerSettings {
pub refresh_index_period: u64,
pub refresh_log_index_period: u64,
pub max_indexed_job_log_size: usize,
pub max_index_time_window_secs: i64,
pub should_clear_job_index: bool,
pub should_clear_log_index: bool,
}
@@ -26,6 +27,7 @@ impl Default for TantivyIndexerSettings {
refresh_index_period: 300,
refresh_log_index_period: 300,
max_indexed_job_log_size: 1_000_000,
max_index_time_window_secs: 60 * 60 * 24 * 7, // 7 days
should_clear_job_index: false,
should_clear_log_index: false,
}
@@ -39,6 +41,7 @@ pub struct TantivyIndexerSettingsOpt {
pub refresh_index_period: Option<u64>,
pub refresh_log_index_period: Option<u64>,
pub max_indexed_job_log_size: Option<usize>,
pub max_index_time_window_secs: Option<i64>,
pub should_clear_job_index: Option<bool>,
pub should_clear_log_index: Option<bool>,
}
@@ -58,6 +61,7 @@ pub async fn load_indexer_config(db: &DB) -> error::Result<TantivyIndexerSetting
refresh_index_period,
refresh_log_index_period,
max_indexed_job_log_size,
max_index_time_window_secs,
writer_memory_budget,
should_clear_job_index,
should_clear_log_index,
@@ -78,6 +82,9 @@ pub async fn load_indexer_config(db: &DB) -> error::Result<TantivyIndexerSetting
max_indexed_job_log_size: config
.max_indexed_job_log_size
.unwrap_or(max_indexed_job_log_size),
max_index_time_window_secs: config
.max_index_time_window_secs
.unwrap_or(max_index_time_window_secs),
should_clear_job_index: config
.should_clear_job_index
.unwrap_or(should_clear_job_index),
@@ -123,6 +130,9 @@ pub fn get_indexer_rates_from_env() -> TantivyIndexerSettings {
if let Some(b) = get_env_var("TANTIVY_MAX_INDEXED_JOB_LOG_SIZE__KB") {
settings.max_indexed_job_log_size = (b * BYTES_PER_KB) as usize;
}
if let Some(b) = get_env_var("TANTIVY_MAX_INDEX_TIME_WINDOW__S") {
settings.max_index_time_window_secs = b as i64;
}
settings
}

View File

@@ -523,7 +523,13 @@
{#if allLogs == undefined}
<div class="text-center pb-2"><Loader2 class="animate-spin" /></div>
{:else if Object.keys(allLogs).length == 0}
<div class="flex justify-center items-center h-full">No logs</div>
<div class="flex flex-col justify-center items-center h-full gap-2">
<span>No logs</span>
<span class="text-2xs text-tertiary"
>Search only covers a recent time window, configurable in instance settings
under Indexer.</span
>
</div>
{:else if minTs && maxTs}
{@const minTsN = new Date(minTs).getTime()}
{@const maxTsN = new Date(maxTs).getTime()}

View File

@@ -85,7 +85,8 @@ const indexerSettingsSchema = z
refresh_index_period: positiveNumber.optional(),
max_indexed_job_log_size: positiveNumber.optional(),
commit_log_max_batch_size: positiveNumber.optional(),
refresh_log_index_period: positiveNumber.optional()
refresh_log_index_period: positiveNumber.optional(),
max_index_time_window_secs: positiveNumber.optional()
})
.passthrough()

View File

@@ -84,6 +84,37 @@
/>
<InputError error={errors.writer_memory_budget ?? ''} />
</div>
<div class="flex flex-col gap-1">
<label for="max_index_time_window_secs" class="block text-xs font-semibold text-emphasis">
Index time window (days)
<Tooltip>
Maximum age of items to include in the index. Jobs and logs older than this window will not
be indexed and will be cleaned up from the index. Set to 0 to disable (index everything
within the retention period).
</Tooltip>
</label>
<IntegerInput
placeholder="7"
id="max_index_time_window_secs"
{disabled}
error={errors.max_index_time_window_secs ?? ''}
value={$values['indexer_settings'].max_index_time_window_secs != null
? Math.round($values['indexer_settings'].max_index_time_window_secs / 86400)
: undefined}
oninput={(v) => {
if (v == null) {
const { max_index_time_window_secs: _, ...rest } = $values['indexer_settings']
$values['indexer_settings'] = rest
} else {
$values['indexer_settings'] = {
...$values['indexer_settings'],
max_index_time_window_secs: v * 86400
}
}
}}
/>
<InputError error={errors.max_index_time_window_secs ?? ''} />
</div>
<Label label="Indexer status">
{#snippet action()}
<button

View File

@@ -244,7 +244,11 @@
<div class="text-sm">There were no completed runs that match your query</div>
{/if}
<div class="text-sm">
Note that new runs might take a while to become searchable (by default ~5min)
Note that new runs might take a while to become searchable (by default ~5min).
{#if indexMetadata?.max_index_time_window_secs}
Search only covers the last {Math.round(indexMetadata.max_index_time_window_secs / 86400)} day(s),
configurable in instance settings under Indexer.
{/if}
</div>
{#if !$enterpriseLicense}
<div class="py-6"></div>