Overview
The search resource provides full-text search across all framework content — articles, recitals, and requirements. Results include a matchContext snippet showing the matched text in context.
Methods
query()
Execute a full-text search and return a page of results.
Parameters
| Parameter | Type | Default | Description |
|---|
query | string | required | Search terms |
framework | string | — | Filter results to a specific framework slug |
resultType | string | — | Filter by content type: "article", "recital", or "requirement" |
page | number | 1 | Page number |
perPage | number | 20 | Items per page (1–100) |
Returns Promise<Page<SearchResult>>
meta.pages is always 0 for search results. This is an endpoint limitation — use meta.total and links.next to determine if more results exist.
iter()
Iterate over all search results without managing pagination.
Parameters — same options as query() (except page, which is managed internally).
Returns AsyncGenerator<SearchResult>
Model
SearchResult
| Field | Type | Description |
|---|
type | string | Result type: "article", "recital", or "requirement" |
frameworkSlug | string | Parent framework slug |
frameworkName | string | Parent framework display name |
articleNumber | number | null | Article number (for article and requirement results) |
recitalNumber | number | null | Recital number (for recital results) |
paragraphRef | string | null | Source paragraph reference |
title | string | null | Article title (for article results) |
requirementType | string | null | Requirement type (for requirement results) |
matchContext | string | Snippet of text surrounding the match |
url | string | Deep link to the matched item in the API |
Examples
Search for a concept across all frameworks
Collect all requirement results mentioning a term
Combine resultType: 'article' with iter() for a simple way to find every article across all frameworks that mentions a specific term — no need to iterate frameworks first.