fix: use exact match for ID fields in full-text search
ID fields (execution_id, correlation_id, exchange_id) should use exact equality, not LIKE with wildcards. LIKE is only needed for the _search_text full-text columns. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -179,16 +179,17 @@ public class ClickHouseSearchIndex implements SearchIndex {
|
||||
params.add(request.durationMax());
|
||||
}
|
||||
|
||||
// Global full-text search: ID fields, execution-level _search_text, OR processor-level _search_text
|
||||
// Global full-text search: exact ID match, full-text on execution + processor level
|
||||
if (request.text() != null && !request.text().isBlank()) {
|
||||
String likeTerm = "%" + escapeLike(request.text()) + "%";
|
||||
conditions.add("(execution_id LIKE ? OR correlation_id LIKE ? OR exchange_id LIKE ?"
|
||||
String term = escapeLike(request.text());
|
||||
String likeTerm = "%" + term + "%";
|
||||
conditions.add("(execution_id = ? OR correlation_id = ? OR exchange_id = ?"
|
||||
+ " 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(term);
|
||||
params.add(term);
|
||||
params.add(term);
|
||||
params.add(likeTerm);
|
||||
params.add(likeTerm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user