> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# SDK Types: Search

**Published**: 2026-11-30
**Category**: Types

## `SearchConfig`

*Interface*

What a browser needs to query Lynkow search directly, without going through your server.
Returned by `lynkow.search.getConfig()`.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `apiKey` | `string` | No | Tenant token (JWT) valid for 1 hour, limited to this site's records. |
| `host` | `string` | No | Base URL of Lynkow search for browser queries. Pass it verbatim as the search client's host. |
| `indexName` | `string` | No | Name of the site's search index, `site_` then the site id with `_` for `-`. Pass it verbatim. |


---

## `SearchHit`

*Interface*

One search result. A hit is an article or, when the site opts commerce into search, a
product, product category or product collection: check `type`. A commerce hit carries at
most `id`, `type`, `slug`, `path`, `title`, `description`, `image` and the locale fields,
never a price or a stock level. Every field is optional: the profile's displayed fields
and the site's indexed fields decide which ones come back.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `_formatted` | `Record<string, unknown>` | Yes | The hit's fields with `<em>` tags around the matched terms, keyed like the hit. Values<br>can be strings, numbers, `null` or nested objects: check the type before rendering. |
| `authorName` | `string` | Yes | Indexed author's full name when selected. Empty string when no author<br>name is available; no default author is substituted. |
| `categories` | `{ name?: string; slug?: string }[]` | Yes | Selected category projections. Empty array when no categories are assigned.<br>Names require `categories.name` in the site's indexed fields; nested<br>display projections can omit either property. |
| `description` | `string \| null` | Yes | Commerce hits only: the product's, category's or collection's description when<br>selected, or `null` when the merchant left it empty. Absent from article hits,<br>and from every hit of a profile whose displayed fields do not list it. |
| `excerpt` | `string` | Yes | Indexed excerpt when selected. Empty string if no excerpt is set;<br>no summary is generated from the body. |
| `featuredImage` | `string \| null` | Yes | Indexed featured image URL when selected, or `null` if no image is set. |
| `id` | `string` | Yes | Hit identifier when selected by the profile's displayed fields: the content<br>UUID for an article, or the public prefixed id of a commerce hit (`'prod_...'`,<br>`'pcat_...'` or `'col_...'`). |
| `image` | `string \| null` | Yes | Commerce hits only: a public image URL when selected (a product's first gallery<br>image, a category's or collection's own image), or `null` when none is set.<br>Absent from article hits (see `featuredImage`), and from every hit of a profile<br>whose displayed fields do not list it. |
| `isFallback` | `boolean` | Yes | `true` when the hit has no translation in `requestedLocale` and is served in the next<br>locale of the site's chain. Present when the request carried a locale, and on every<br>commerce hit. |
| `locale` | `string` | Yes | Locale the hit is served in, such as `'fr'`. Without a requested locale, an article<br>carries its own locale and a commerce hit the site default locale. |
| `metaDescription` | `string` | Yes | Indexed SEO description when selected. Empty string if unset;<br>apply an excerpt fallback in your UI when needed. |
| `metaTitle` | `string` | Yes | Indexed SEO title when selected. Empty string if no override is set;<br>apply a title fallback in your UI when needed. |
| `path` | `string` | Yes | Public URL path when selected: including locale and category prefixes for an<br>article (e.g. `'/fr/guides/forms'`), or the commerce page's public URL built from<br>the site's commerce URL prefixes (e.g. `'/products/blue-mug'`), the one<br>`paths.resolve()` recognises. A hit without this field has no supplied link. |
| `publishedAt` | `number` | Yes | Publication Unix timestamp in seconds when selected, or `0` when unavailable. |
| `requestedLocale` | `string` | Yes | The locale the search asked for (the `locale` option, else the client<br>locale). Present only when the request carried a locale. |
| `slug` | `string` | Yes | URL-safe slug when selected: unique within the site and locale for an article,<br>or the product's, category's or collection's own slug for a commerce hit (the<br>one its `getBySlug()` read accepts). |
| `tags` | `{ name?: string; slug?: string }[]` | Yes | Selected tag projections. Empty array when no tags are assigned.<br>Names require `tags.name` in the site's indexed fields; nested display<br>projections can omit either property. |
| `title` | `string` | Yes | Indexed title when selected: the content title in the searched locale, the<br>product or collection title, or a product category's name.<br>See `_formatted.title` for the highlighted variant. |
| `type` | `string` | Yes | Hit kind when selected. For an article, its stored content type, with<br>`'article'` as the indexer's fallback. For a commerce hit, one of `'product'`,<br>`'product_category'` or `'product_collection'`. |
| `updatedAt` | `number` | Yes | Last update Unix timestamp in seconds when selected, or `0` when unavailable. |


---

## `SearchOptions`

*Interface*

Options for `lynkow.search.search()` and `lynkow.search.searchByProfile()`. All are
optional. The inherited `fallback: false` leaves out the hits served in another locale
than the requested one.

Extends: `BaseRequestOptions`

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `category` | `string` | Yes | Filter by category slug (e.g. `'guides'`). Matches articles only. |
| `fallback` | `boolean` | Yes | Set `false` to refuse records served in another locale: a detail read then<br>throws `NOT_FOUND` and a list drops them. Fallback is on by default. Reads<br>without locale fallback ignore it. |
| `fetchOptions` | `RequestInit` | Yes | `fetch()` options for this request, shallow-merged over the client's<br>`fetchOptions`, such as `{ next: { revalidate: 60 } }`. |
| `limit` | `number` | Yes | Results per page. Defaults to the profile's `defaultLimit` (20 on the default profile), capped at its `maxLimit`. |
| `locale` | `string` | Yes | Locale to search in, such as `'fr'`. Defaults to the client locale. With neither,<br>articles are not filtered by locale and commerce hits come back in the site default locale. |
| `market` | `string` | Yes | Id (`mkt_...`) of one of the site's markets. Products the merchant hid in that<br>market are left out of the hits. An unknown or draft market, or a site with markets<br>turned off, filters nothing. |
| `page` | `number` | Yes | Page number, counted from 1. Defaults to `1`. |
| `tag` | `string` | Yes | Filter by tag slug (e.g. `'featured'`). Matches articles only. |


---

## `SearchProfilePublic`

*Interface*

A public search profile, as returned by `lynkow.search.listProfiles()`: a search scope with
its own fields, facets, sort and limits over the site's one search index.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `defaultLimit` | `number` | No | Page size used when the request sends no `limit`. |
| `description` | `string \| null` | No | What the profile covers, as written in the admin. `null` when unset. |
| `displayedFields` | `string[]` | No | Fields the profile returns. Pass verbatim as `attributesToRetrieve` in a browser query. |
| `facets` | `string[]` | No | Fields you can facet on, such as `categories.slug` or `type`. Empty array when none is enabled. |
| `filter` | `string \| null` | No | The profile's scope as a filter expression, to pass verbatim as the `filter` of a browser<br>query made with SearchService.getConfig. `null` when the profile searches the whole site. |
| `maxLimit` | `number` | No | Largest `limit` the profile accepts. A larger one is lowered to it. |
| `name` | `string` | No | Display name the site administrator gave the profile. |
| `searchableFields` | `string[]` | No | Fields the profile searches. Pass verbatim as `attributesToSearchOn` in a browser query. |
| `slug` | `string` | No | Profile identifier, such as `'default'` or `'api-docs'`. Pass it to `searchByProfile()`. |
| `sort` | `string[]` | No | Default sort, such as `['publishedAt:desc']`. Empty array to rank by relevance only. |


---

## `SearchResponse`

*Interface*

Response from `lynkow.search.search()` and `lynkow.search.searchByProfile()`: one page of
hits and its paging metadata.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `data` | `SearchHit[]` | No | Hits of the current page, ordered by relevance. Empty array when nothing matches. |
| `meta` | `{ facetDistribution?: Record<string, Record<string, number>> \| null; page: number; perPage: number; processingTimeMs: number; profile: string; query: string; total: number; totalPages: number }` | No | Paging and query metadata. Its keys differ from PaginationMeta: `page`,<br>`totalPages` and `perPage`. |