发布

  • [OPIK-4516] [BE][FE] Add full-text search for traces, spans, and threads (#5391)

    frostbyte_neo 发布于 2026-03-04 09:31:30 +00:00

    • [OPIK-4516] [BE][FE] Add full-text search for traces

    Backend:

    • Add search query param to traces list and stats endpoints
    • Add search_text conditional clause to TraceDAO SQL templates
      (SELECT_BY_PROJECT_ID, COUNT_BY_PROJECT_ID, SELECT_TRACES_STATS)
    • Wire search through TraceSearchCriteria and DatabaseUtils

    Frontend:

    • Pass search as dedicated query param instead of ID filter
    • Update search placeholders per tab (traces, spans, threads)
    • Revision 1: Add search match column highlighting in traces table
    • Highlight table cells whose values match the search query
    • Normalize search input (trim + lowercase) once at the source to avoid redundant requests and repeated transformations
    • Suppress highlights while stale data is displayed during refetch
    • Revision 2: Refactor search query and improve search UX
    • Replace concat+LIKE with individual ilike OR clauses per column
    • Define search clause as a static constant in DatabaseUtils, reused across 3 queries in TraceDAO
    • Add wildcard wrapping in Java at bind time instead of CONCAT in SQL
    • Normalize search input (trim + lowercase) once via trimmedSearch to avoid redundant backend requests
    • Highlight search input border when results are displayed
    • Only show highlights and active border after data loads, not during fetch
    • Revision 3: Add full-text search for spans and threads
    • Add search query param to SpansResource (getSpansByProject, getStats)
    • Add search query param to TracesResource (getTraceThreads, getThreadStats)
    • Add searchText field to SpanSearchCriteria
    • Add SPAN_SEARCH_CLAUSE in SpanDAO (id, trace_id, name, type, input, output, metadata, tags, model, provider)
    • Add THREAD_SEARCH_CLAUSE in ThreadDAO (thread_id, id, input, output)
    • Move TRACE_SEARCH_CLAUSE from DatabaseUtils to TraceDAO
    • Make newTraceThreadFindTemplate accept search clause as parameter
    • Frontend: useSpansList, useSpansStatistic, useThreadsList, useThreadsStatistic send search as query param instead of converting to ID filter
    • Revision 4: Add integration tests for full-text search across traces, spans, and threads

    • Revision 5: Remove yellow highlight from search input box

    • Revision 6: Parameterize search tests

    • Revision 7: Remove cell highlighting from search results

    下载附件