SearchConfig

Interface

Configuration for client-side direct search.

Returned by lynkow.search.getConfig(). Use these values to initialize a search client in the browser for instant autocomplete without round-tripping through your server.

Property

Type

Optional

Description

apiKey

string

No

Short-lived tenant token (JWT, 1-hour expiry) scoped to your site's index

host

string

No

Public Lynkow search host URL (e.g. 'https://search.lynkow.com').<br>Pass verbatim as the host when instantiating a search client in<br>the browser (for example the meilisearch-js npm package, which<br>speaks the same protocol). Does not include a trailing slash.

indexName

string

No

Lynkow search index name for this site, of the form<br>site-<siteId>_<locale> or site-<siteId> for single-locale sites.<br>Pass verbatim as the index parameter in browser search queries.


SearchHit

Interface

A single search result (hit) returned by Lynkow Instant Search.

Contains article metadata, URL path, and optional highlighted matches. Only published content appears in search results.

Property

Type

Optional

Description

_formatted

Record<string, string>

Yes

Highlighted matches with <em> tags around matching terms.<br>Only present when the search engine returns formatted results.<br>Keys match the field names (e.g. title, excerpt, body).

authorName

string

No

Full name of the content author (or the site's default author<br>when the content has no explicit author). Always non-empty because<br>the indexer requires a tokenizable value.

categories

{ name: string; slug: string }[]

No

Categories assigned to this content as minimal { name, slug }<br>projections. Empty array when the content has no category. Use the<br>slug to build category URLs and pass to<br>CategoriesService.getBySlug for full detail.

excerpt

string

No

Short text summary shown in the search dropdown. Taken from the<br>content's excerpt field, or generated from the first paragraph<br>when excerpt is empty. Always non-null in search results.

featuredImage

string | null

No

Featured image URL, or null if none

id

string

No

Content UUID. Matches id on Content / ContentSummary.

locale

string

No

Content locale code (e.g. 'fr', 'en')

metaDescription

string

No

SEO meta description. Falls back to excerpt when the content<br>has no override. Max ~500 characters, typically under 160 for<br>search snippets.

metaTitle

string

No

SEO meta title. Falls back to title when the content has no<br>override. Max ~255 characters, generally kept under 60 for search<br>result listings.

path

string

No

Full URL path including locale and category prefix (e.g. '/fr/guides/forms')

publishedAt

number

No

Publication date as Unix timestamp (seconds)

slug

string

No

URL-safe slug. Unique within the site + locale combination.

tags

{ name: string; slug: string }[]

No

Tags assigned to this content as minimal { name, slug }<br>projections. Empty array when the content has no tag. Use the<br>slug for tag-filtered listings.

title

string

No

Content title in the searched locale. Never empty (the indexer skips<br>untitled drafts). May contain <em> markers when highlighting is<br>enabled; see _formatted.title for the highlighted variant.

type

string

No

Content type slug. Currently always 'post'; the value is exposed<br>to support future content types (product, event, etc.) without a<br>breaking schema change.

updatedAt

number

No

Last update date as Unix timestamp (seconds)


SearchOptions

Interface

Options for lynkow.search.search().

All filters are optional. When omitted, searches across all published content in all locales.

Extends: BaseRequestOptions

Property

Type

Optional

Description

category

string

Yes

Filter by category slug (e.g. 'guides'). Omit to search all categories.

fetchOptions

RequestInit

Yes

Raw fetch() options merged into this specific request.<br>Useful for setting Next.js cache directives (next: { revalidate: 60 })<br>or custom headers on a per-request basis.<br>These options are shallow-merged with the client-level fetchOptions.

limit

number

Yes

Results per page (1--100). Defaults to 20.

locale

string

Yes

Filter by locale code (e.g. 'fr', 'en'). Omit to search all locales.

page

number

Yes

Page number (1-based). Defaults to 1.

tag

string

Yes

Filter by tag slug (e.g. 'featured'). Omit to search all tags.


SearchProfilePublic

Interface

A public-facing search profile descriptor.

Returned by lynkow.search.listProfiles(). Profiles let site admins create scoped search experiences (e.g. "API docs", "Marketing", "Help") each with its own facets and result shape, while sharing a single underlying search index per site.

Property

Type

Optional

Description

defaultLimit

number

No

Default page size applied when the request omits limit. Always<br>positive; admins set it between 1 and 100.

description

string | null

No

Optional admin-authored description explaining what the profile<br>covers. null when the admin did not provide one.

displayedFields

string[]

No

Subset of fields the profile returns. Pass verbatim as the<br>attributesToRetrieve option to keep the browser-side response<br>shape aligned with the admin-configured projection.

facets

string[]

No

Field names available for facet aggregation when querying this<br>profile. Pass these to a UI that renders facet checkboxes (e.g.<br>categories.slug, tags.slug, type, locale). Empty array when<br>the admin did not enable any facet.

filter

string | null

No

Pre-compiled scope filter, ready to pass verbatim as the filter<br>option of a browser-side search engine query. null when the<br>profile has no scope (i.e. searches the entire site). Combine this<br>with the tenant token from SearchService.getConfig to do<br>profile-aware instant search directly from the browser, without<br>round-tripping through Lynkow's API on every keystroke.

maxLimit

number

No

Upper bound on limit accepted by the search endpoint. Requests<br>with a higher limit are clamped to this value. Always positive.

name

string

No

Human-readable label shown in profile selectors. Localized to the<br>site's default locale at the time the profile was last edited.

searchableFields

string[]

No

Subset of indexed fields that the profile actually queries. Pass<br>verbatim as the attributesToSearchOn option to the search engine<br>to mirror the server-side behaviour of<br>SearchService.searchByProfile on the browser side.

slug

string

No

URL-safe identifier for the profile (e.g. 'default', 'api-docs').<br>Pass this value to lynkow.search.searchByProfile() to query the<br>profile. Stable for the lifetime of the profile; renaming the slug<br>via the admin breaks any URL or bookmark referencing it.

sort

string[]

No

Default sort directives (e.g. ['publishedAt:desc']). Empty array<br>means the search engine ranks by relevance only. Pass verbatim as<br>the sort option.


SearchResponse

Interface

Response from lynkow.search.search().

Contains an array of matching articles and pagination metadata.

Property

Type

Optional

Description

data

SearchHit[]

No

Matching articles for the current page of results, already ordered<br>by relevance. Empty array when the query matches nothing.

meta

{ page: number; perPage: number; processingTimeMs: number; query: string; total: number; totalPages: number }

No

Pagination and query metadata for rendering controls like "N results<br>in 42 ms" or a paginator. Uses snake-free naming (page,<br>totalPages, perPage) that differs from the standard<br>PaginationMeta because the search engine response predates<br>the common pagination type.