Skip to main content

getAdminsByVectorSearch

Semantic (vector) search for admins.

Description

This method performs a semantic (vector) search for admins from a natural-language query - it matches on meaning rather than exact keywords. It returns a Promise that resolves to an IAdminsResponse object - a container with items (the admins) and total - not a bare array.

Admins.getAdminsByVectorSearch(

body*, langCode, offset, limit

);

Parameters schema

Schema

body(required): IAdminsVectorSearch
Vector search body
example:

{ queryText: "content manager" }

body.queryText(required): string
Natural-language search query.
example: "content manager"

body.vectorDistanceThreshold: number
Override of the cosine distance threshold (0..2).
example: 0.3

body.maxHits: number
Top-K candidates fetched before pagination. Default: 100. Max: 500.
example: 10

body.debug: boolean
When true, each returned item gets a distance field.
example: false

langCode: string
Language code. Default: "en_US"
example: "en_US"

offset: number
Parameter for pagination. Default: 0
example: 0

limit: number
Parameter for pagination. Default: 30
example: 30

Examples

Minimal example

const response = await Admins.getAdminsByVectorSearch({ queryText: 'content manager' });

Example with attributes

const response = await Admins.getAdminsByVectorSearch(
{
queryText: 'content manager',
vectorDistanceThreshold: 0.3,
maxHits: 50,
debug: true,
},
'en_US',
0,
30,
);

Example response

{
"items": [
{
"id": 1,
"attributeSetId": 27,
"identifier": "admin",
"attributeSetIdentifier": "admins",
"position": 1,
"isSync": true,
"attributeValues": {
"admin-text": {
"type": "string",
"value": "",
"position": 0,
"additionalFields": {}
}
},
"formModuleConfigs": []
}
],
"total": 1
}

Response schema

Schema: IAdminsResponse

items: IAdminEntity[]
Array of found admin objects.

items.id: number
The identifier of the object.
example: 1764

items.attributeSetId: number | null
The identifier of the attribute set being used.
example: 120

items.identifier: string
The textual identifier for the record field.
example: "admin1"

items.attributeSetIdentifier: string | null
The identifier of the attribute set.
example: "admins"

items.position: number | null
Position number (for sorting).
example: 1

items.isSync: boolean
Page indexing flag (true or false).
example: true

items.attributeValues: IAttributeValues
Array of attribute values from the index (presented as a pair of user attribute identifier: attribute value).
example:

[
{
"marker": {
"type": "string",
"value": "Some value"
}
}
]

items.moduleFormConfigs: IFormConfig[]
Array of module form configurations associated with the admin.

items.moduleFormConfigs.id: number
The identifier of the form configuration.
example: 123

items.moduleFormConfigs.formIdentifier: string
The form identifier (only in products/pages API).
example: "review"

items.moduleFormConfigs.moduleIdentifier: string
The identifier of the module associated with the form configuration.
example: "module_identifier"

items.moduleFormConfigs.isGlobal: boolean
Indicates whether the form configuration is global.
example: true

items.moduleFormConfigs.isClosed: boolean
Indicates whether the form configuration is closed.
example: true

items.moduleFormConfigs.isModerate: boolean
Indicates whether the form requires moderation (only in products/pages API).
example: false

items.moduleFormConfigs.viewOnlyUserData: boolean
Indicates whether the form configuration allows viewing user data (used in forms API).
example: true

items.moduleFormConfigs.commentOnlyUserData: boolean
Indicates whether the form configuration allows commenting on user data (used in forms API).
example: true

items.moduleFormConfigs.viewOnlyMyData: boolean
Indicates whether the form configuration allows viewing my data (used in products/pages API).
example: false

items.moduleFormConfigs.commentOnlyMyData: boolean
Indicates whether the form configuration allows commenting on my data (used in products/pages API).
example: false

items.moduleFormConfigs.entityIdentifiers: object[]
An array of entity identifiers associated with the form configuration.

items.moduleFormConfigs.nestedEntityIdentifiers: string[]
An array of nested entity identifier strings (only in products/pages API).
example: ["catalog"]

items.moduleFormConfigs.exceptionIds: string[]
An array of exception identifiers.

items.moduleFormConfigs.formDataCount: number
Total count of form data entries (only in products/pages API).
example: 306

items.moduleFormConfigs.entityFormDataCount: Record<string, number>
Form data count per entity identifier (only in products/pages API).
example:

{"catalog": 306}

items.moduleFormConfigs.isRating: boolean | null
Indicates whether this form config is for ratings.
example: null

items.moduleFormConfigs.isAnonymous: boolean | null
Indicates whether anonymous submissions are allowed.
example: null

items.moduleFormConfigs.allowHalfRatings: boolean | null
Indicates whether half ratings are allowed.
example: null

items.moduleFormConfigs.allowRerating: boolean | null
Indicates whether re-rating is allowed.
example: null

items.moduleFormConfigs.maxRatingScale: number | null
Maximum rating scale value.
example: 5

items.moduleFormConfigs.ratingCalculation: string
Rating calculation method.
example: "average"
items.distance: number
Cosine distance to the query. Returned only by the semantic (vector) search endpoint when debug: true is passed in the search body.
example: 0.12

total: number
Total number of found records.
example: 100

ℹ️ Semantic search matches on meaning, not on the literal text. For keyword matching across every entity type at once use globalSearch().