Interface: CustomIndexDefinition¶
Defined in: schema.ts:1167
Defines how to index schemas for use with full-text indexing.
Extends¶
BaseIndexDefinition
Properties¶
contextProperties?¶
optionalcontextProperties:ContextProperties
Defined in: schema.ts:1227
A list of additional properties from within ObjectSchemaDefinition.properties that provide context about the record. These properties typically contain short-form text, such as categories, folder names, etc. The content of these properties will be duplicated in each chunk of text that results from indexing the content in the indexed properties. Context properties help with retrieval, increasing the likelihood that the LLM will find the desired records.
Example¶
const ManufacturerSchema = coda.makeObjectSchema({
properties: {
name: { type: coda.ValueType.String },
id: { type: coda.ValueType.String },
},
displayProperty: "name",
});
const ProductSchema = coda.makeObjectSchema({
properties: {
// ...
size: { type: coda.ValueType.String },
materials: {
type: coda.ValueType.Array,
items: { type: coda.ValueType.String },
},
manufacturer: ManufacturerSchema,
},
// ...
index: {
// ...
contextProperties: ["size", "materials", "manufacturer.name" ],
},
});
filterableProperties?¶
optionalfilterableProperties:FilterableProperty[]
Defined in: schema.ts:1161
A list of properties from within ObjectSchemaDefinition.properties that will be made available to filter the results of a search. Limited to 5 properties, so these should be the properties most likely to be useful as filters.
Inherited from¶
BaseIndexDefinition.filterableProperties
properties¶
properties:
IndexedProperty[]
Defined in: schema.ts:1191
A list of properties from within ObjectSchemaDefinition.properties that should be indexed. These properties typically contain long-form text such as descriptions, notes, and message bodies. The content of these properties will be broken down into smaller chunks for retrieval and usage by the LLM.
Example¶
const ProductSchema = coda.makeObjectSchema({
properties: {
// ...
specSheetLink: {
type: coda.ValueType.String,
codaType: coda.ValueHintType.Attachment,
description: "Link the PDF spec sheet for the product.",
},
},
// ...
index: {
properties: ["specSheetLink"],
},
});