fix: include execution/correlation/exchange IDs in full-text search
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:
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user