Query Examples

Query Examples HTTP endpoints — CRUD, faceted search, and per-entity / per-term lookup and linking. 16 endpoints across three groups.

Query Examples are exposed through QueryExampleController (the snippet itself) and through the Data Entity / Term controllers (the linking surface). All actions are gated by the seven QUERY_EXAMPLE_* permissions documented under Query Examples → Permissions (RBAC). For the feature description, the term-linking workflow, and the UI walkthrough, see the Query Examples page.

CRUD (5 endpoints)

Method + Path
Operation

GET /api/queryexample

Paginated list of all snippets. Accepts query for free-text filter.

POST /api/queryexample

Create a new snippet.

GET /api/queryexample/{example_id}

Get full details.

PUT /api/queryexample/{example_id}

Update.

DELETE /api/queryexample/{example_id}

Delete.

Faceted search (5 endpoints)

The same multi-step facet flow the main catalog uses — start a search to get a search_id, then read / update / paginate against that ID.

Method + Path
Operation

POST /api/queryexample/search

Start a search; returns the search_id and initial facet aggregations (operation queryExamplesSearch).

GET /api/queryexample/search/{search_id}

Read the current facet values for a search.

PUT /api/queryexample/search/{search_id}

Update facets (apply filters).

GET /api/queryexample/search/{search_id}/results

Paginated result list for a search.

GET /api/queryexample/search/suggestions

Top-five matching snippet titles for a query string — used by the search-input typeahead.

Per-entity / per-term lookup and linking (6 endpoints)

Lookup is on QueryExampleController; linking lives on DataEntityController and the term API.

Method + Path
Operation

GET /api/queryexample/dataset/{data_entity_id}

List all snippets attached to a dataset.

GET /api/queryexample/term/{term_id}

List all snippets attached to a term.

POST /api/dataentities/{data_entity_id}/queryexample

Attach a snippet to a dataset (gated by QUERY_EXAMPLE_DATASET_CREATE).

DELETE /api/dataentities/{data_entity_id}/queryexample/{example_id}

Detach a snippet from a dataset (gated by QUERY_EXAMPLE_DATASET_DELETE).

POST /api/terms/{term_id}/queryexample

Attach a snippet to a term (operationId createQueryExampleToTermRelationship; gated by QUERY_EXAMPLE_TERM_CREATE). The example is identified in the request body, not in the path.

DELETE /api/terms/{term_id}/queryexample/{example_id}

Detach a snippet from a term (operationId deleteQueryExampleToTermRelationship; gated by QUERY_EXAMPLE_TERM_DELETE).

See also

Last updated