---
title: "Search Press Releases"
method: POST
path: "/api/internal/press-releases/search"
tags: ["Press Releases"]
---

# Search Press Releases

`POST /api/internal/press-releases/search`

Search press release chunks.

The ``query`` field is evaluated against the chunks' ``search_vector`` via
``websearch_to_tsquery('english', ...)`` — stemming on, websearch syntax
(quoted phrases, OR, leading - to exclude).

Pass ``group_by_document=true`` to collapse to one chunk per press release
(the highest-ranked when a query is supplied; the earliest chunk otherwise).
The response's ``other_matching_chunks_in_document`` field shows how many
other chunks in that doc also matched — useful for deciding whether to
drill in.

At least one of ``institution_ids`` or ``query`` is required.

## Request body

- PressReleaseSearchFilters — Search filters for press release chunks. The ``query`` field accepts a websearch-style query string evaluated against the chunks' ``search_vector`` column (english config — stemming enabled). Same syntax as the other chunk-search endpoints. At least one of ``institution_ids`` or ``query`` must be supplied — the chunks table is large enough that fully unbounded scans are rejected. Institution scoping alone (with no query) lists that institution's chunks in reverse-chronological order of the parent press release, useful for surveying what we have.
  - `query` string, nullable
  - `institution_ids` string[], nullable
  - `states` string[], nullable
  - `source_tables` string[], nullable
  - `date_after` string, date, nullable
  - `date_before` string, date, nullable
  - `group_by_document` boolean
  - `offset` integer
  - `limit` integer

## Response `200`

Successful Response

- PaginatedResponsePressReleaseChunkResponse
  - `results` PressReleaseChunkResponse[], required
    - `chunk_id` integer, required
    - `document_id` string, required
    - `institution_id` string, nullable
    - `institution_name` string, nullable
    - `institution_state` string, nullable
    - `institution_type` string, nullable
    - `document_date` string, date-time, nullable
    - `document_title` string, nullable
    - `document_url` string, nullable
    - `document_created_at` string, date-time, nullable
    - `text` string, required
    - `relevance` number, nullable
    - `other_matching_chunks_in_document` integer, nullable
  - `total` integer, required
  - `offset` integer, required
  - `limit` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/nationgraph/apis/nationgraph-api.md) · [All operations](https://skmtc.net/nationgraph/apis/nationgraph-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nationgraph/nationgraph-api/revisions/85804e68d86d/schema)
