getPagesByVectorSearch
Semantic (vector) search for pages.
Description
Runs a semantic (vector) search for pages from a natural-language query, matching on meaning rather than exact keywords. Resolves to an IVectorSearchResponse<IPagesResponse>, not an array: the pages are in items, the count in total, and indexReady says whether the search index is built.
When indexReady is false, the index for this entity and language isn't built yet: the query wasn't embedded, and empty items don't mean that nothing matched.
.getPagesByVectorSearch(
,
,
,
);
Parameters schema
Schema
body(required): IPagesVectorSearch
Vector search parameters.
example:
{ queryText: "winter sale" }
body.queryText(required): string
Natural-language search query.
example: "winter sale"
body.vectorDistanceThreshold: number
Override of the cosine distance threshold (0..2).
example: 0.3
body.maxHits: number
Number of top candidates fetched before pagination. Default: 100. Maximum: 500.
example: 10
body.debug: boolean
Deprecated and ignored: the API no longer reads debug and returns distance on every item.
example: false
langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"
offset: number
Number of records to skip. Default: 0. offset + limit must not exceed 200; a larger window is rejected with 400.
example: 0
limit: number
Maximum number of records to return. Default: 30.
example: 30
Examples
Minimal example
const response = await Pages.getPagesByVectorSearch({ queryText: 'winter sale' });
Example with all parameters
const response = await Pages.getPagesByVectorSearch(
{
queryText: 'winter sale',
vectorDistanceThreshold: 0.3,
maxHits: 50,
},
'en_US',
0,
30,
);
Example response
{
"items": [],
"total": 0,
"indexReady": false
}
Response schema
Schema: IVectorSearchResponse<IPagesResponse>
items: IPagesEntity[]
Pages that match the query.
items.id: number
Object ID.
example: 8
items.parentId: number | null
ID of the parent page; null for a top-level page.
example: 10
items.pageUrl: string
URL of the page.
example: "blog"
items.depth: number
Nesting level of the page: 0 for a top-level page, 1 for its children, and so on.
example: 10
items.localizeInfos: ILocalizeInfo
Localized page content: title, menuTitle, htmlContent and plainContent.
example:
{
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
}
items.isVisible: boolean
Whether the page is visible.
example: true
items.type: PageType
Page type.
example: "common_page"
items.templateIdentifier: string | null
Marker of the linked template.
example: "template"
items.attributeSetIdentifier: string | null
Marker of the attribute set, or null if none is assigned.
example: "page"
items.attributeValues: IAttributeValues
Attribute values keyed by marker; an empty object when there are none.
example:
{
"text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": {}
}
}
items.isSync: boolean
Whether the page's attribute index is up to date for the requested language.
example: true
items.template: object
Template linked to the page.
example:
{}
items.position: number
Position used for sorting.
example: 2
items.config: Record<string, number>
Output settings for catalog pages.
example:
{
"rowsPerPage": 1,
"productsPerRow": 1
}
items.products: number
Number of products linked to the page.
example: 0
items.childrenCount: number
Number of child pages.
example: 1
items.blocks: IBlockEntity[] | string[]
Blocks attached to the page: block objects or their markers.
example:
[
"product_block"
]
items.nestedBlocks: IBlockEntity[] | string[]
Blocks attached to the page's nested entities (catalog product preview, etc.): block objects or their markers. Returned by the semantic (vector) search / indexed page responses, as a list of markers.
example:
[
"product_block",
"similar"
]
items.moduleFormConfigs: Array<IFormConfig>
Form configurations of the module linked to the page.
items.rating: IRating
Rating data: average value, likes and dislikes, and the calculation method.
items.categoryPath: string | null
Category path; null for nested pages that have no category path of their own.
example: "catalog"
items.distance: number
Cosine distance to the query. Returned on every item by the semantic (vector) search endpoint.
example: 0.12
total: number
Total number of found records.
example: 100
indexReady: boolean
false when no vectors are built yet for this entity and language: the query was not embedded, so empty items do not mean that nothing matched. true means the result comes from a real search.
Semantic search matches on meaning, not on the literal text. For keyword matching across products, pages, blocks and discounts in one call, use globalSearch().