fix: include execution/correlation/exchange IDs in full-text search
Some checks failed
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m12s
CI / deploy (push) Has been cancelled
CI / deploy-feature (push) Has been cancelled
CI / docker (push) Has been cancelled

The _search_text materialized column only contained error messages,
bodies, and headers — not execution_id, correlation_id, exchange_id,
or route_id. Searching by ID via cmd-k returned no results.

- Add ID fields to _search_text in ClickHouse DDL (covered by ngram
  bloom filter index)
- Add direct LIKE matches on execution_id, correlation_id, exchange_id
  in the text search WHERE clause for faster exact ID lookups

Requires ClickHouse table recreation (fresh install).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-01 21:12:15 +02:00
parent 92951f1dcf
commit 9781fe0d7c
2 changed files with 8 additions and 3 deletions

View File

@@ -179,14 +179,18 @@ public class ClickHouseSearchIndex implements SearchIndex {
params.add(request.durationMax());
}
// Global full-text search: execution-level _search_text OR processor-level _search_text
// Global full-text search: ID fields, execution-level _search_text, OR processor-level _search_text
if (request.text() != null && !request.text().isBlank()) {
String likeTerm = "%" + escapeLike(request.text()) + "%";
conditions.add("(_search_text LIKE ? OR execution_id IN ("
conditions.add("(execution_id LIKE ? OR correlation_id LIKE ? OR exchange_id LIKE ?"
+ " OR _search_text LIKE ? OR execution_id IN ("
+ "SELECT DISTINCT execution_id FROM processor_executions "
+ "WHERE tenant_id = 'default' AND _search_text LIKE ?))");
params.add(likeTerm);
params.add(likeTerm);
params.add(likeTerm);
params.add(likeTerm);
params.add(likeTerm);
}
// Scoped body search in processor_executions

View File

@@ -30,7 +30,8 @@ CREATE TABLE IF NOT EXISTS executions (
is_replay Bool DEFAULT false,
_search_text String MATERIALIZED
concat(error_message, ' ', error_stacktrace, ' ', attributes,
concat(execution_id, ' ', correlation_id, ' ', exchange_id, ' ', route_id,
' ', error_message, ' ', error_stacktrace, ' ', attributes,
' ', input_body, ' ', output_body, ' ', input_headers,
' ', output_headers, ' ', root_cause_message),