JavaScript index schema example
An index schema defines the structure of a Query index as well as the mapping of the items that goes into the index which are queryable from the Query API.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
/** @type {Enterspeed.IndexSchema} */
export default {
triggers: function(context) {
context.triggers('pim', ['product'])
},
index: {
fields: {
sku: { type: "keyword" },
title: { type: "text" },
description: { type: "text" },
isActive: { type: "boolean" }
}
},
properties: function (sourceEntity) {
return {
sku: sourceEntity.properties.sku,
title: sourceEntity.properties.title,
description: sourceEntity.properties.description,
isActive: sourceEntity.properties.isActive
}
}
}
Was this page helpful?