Fix search human-mode output to match engine API response
The Go client struct expected a nested document object and top-level page/section fields, but the engine returns flat results with metadata in chunk_metadata. This caused empty display for title, type, tags, page, and section in human output mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
## Why
|
||||
|
||||
The Go client's human-mode search output struct expects a nested `document` object and top-level `page`/`section` fields, but the engine API returns flat results with `title`, `doc_type`, `tags` at the result level and `page`/`section_header` inside `chunk_metadata`. This means human-mode display shows empty values for title, type, tags, page, and section.
|
||||
|
||||
## What Changes
|
||||
|
||||
- Fix the Go client search result struct to match the flat engine API response format
|
||||
- Extract `page` and `section_header` from the `chunk_metadata` map instead of expecting them as top-level fields
|
||||
- Human-mode output will correctly display document title, type, tags, page number, and section header
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
(none)
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
- `go-client`: Fix search result parsing to match actual engine API response shape
|
||||
|
||||
## Impact
|
||||
|
||||
- `client/cmd/search.go` — struct definition and display logic
|
||||
- No API changes, no breaking changes — this is a bug fix aligning the client with the existing API contract
|
||||
Reference in New Issue
Block a user