Files
shmuelcoyas-rgb 82fa667137 feat: add search-fields value search and dashboards semantic search (#40)
(https://coralogix.atlassian.net/browse/AIAG-533)

## Summary

- **`cx search-fields <text>`** now supports two search types via
`--search-type` / `-s`:
- `semantic` (default) — description-based field discovery, same API as
before
- `value` — search fields by value content (`-s value`), formerly a
separate `search-by-value` command
- `--dataset all` is accepted with `-s value` only; `--offset` for
pagination
- **`cx search-by-value` removed** — merged into `search-fields -s
value`. No longer appears as a top-level command.
- **`cx dashboards search <description>`** — new subcommand: semantic
search over dashboards by natural-language description.
- **`cx dashboards query-search --description <text>`** — search
dashboard widget query content semantically.
- **`cx dashboards query-search --field <path>`** — find all dashboard
queries referencing a specific DataPrime field path.

## Interface

```bash
# Semantic field discovery (default)
cx search-fields "http response status code"
cx search-fields "error severity level" --dataset spans --limit 10

# Value-content search
cx search-fields "payment" -s value --dataset logs
cx search-fields "kubernetes pod" -s value --dataset all --limit 20 --offset 10

# Dashboard semantic search
cx dashboards search "error rate monitoring"
cx dashboards query-search --description "http status 500"
cx dashboards query-search --field '$d.http.status_code'
```

## API paths

| Command | Method | Path |
|---|---|---|
| `search-fields` (semantic, default) | `POST` |
`/api/v1/semantic-search/fields` |
| `search-fields -s value` | `POST` | `/api/v1/search-by-value` |
| `dashboards search` | `GET` |
`/api/v1/olly-kb/dashboards/semantic-search` |
| `dashboards query-search --description` | `GET` |
`/api/v1/olly-kb/dashboards/queries/search` |
| `dashboards query-search --field` | `GET` |
`/api/v1/olly-kb/queries/by-field` |

All commands support `--output text|json|agents` and multi-profile
fan-out.

## Test coverage

- **Unit** — `SearchByValueResult` deserialization tests in
`search_by_value/api.rs`
- **Integration** — wiremock-based tests in
`tests/search_fields_value.rs` and `tests/dashboard_commands.rs`
- **E2E** — `#[ignore]` tests covering all new subcommands; asserts
non-empty real results for semantic and value search, correct response
shapes for `query-search --description` and `--field`

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Shmuel Coyas <shmuel.coyas@shmuel.coyas-MacBookPro>
2026-05-12 12:17:13 +03:00
..