# Interface: CustomIndexDefinition

Defined in: [schema.ts:1167](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1167)

Defines how to index schemas for use with full-text indexing.

## Extends

- `BaseIndexDefinition`

## Properties

### contextProperties?

> `optional` **contextProperties**: [`ContextProperties`](../../type-aliases/ContextProperties/)

Defined in: [schema.ts:1227](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1227)

A list of additional properties from within [ObjectSchemaDefinition.properties](../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](#properties). Context properties help with retrieval, increasing the likelihood that the LLM will find the desired records.

#### Example

```
const ManufacturerSchema = sdk.makeObjectSchema({
  properties: {
    name: { type: sdk.ValueType.String },
    id: { type: sdk.ValueType.String },
  },
  displayProperty: "name",
});

const ProductSchema = sdk.makeObjectSchema({
  properties: {
    // ...
    size: { type: sdk.ValueType.String },
    materials: {
      type: sdk.ValueType.Array,
      items: { type: sdk.ValueType.String },
    },
    manufacturer: ManufacturerSchema,
  },
  // ...
  index: {
    // ...
    contextProperties: ["size", "materials", "manufacturer.name" ],
  },
});
```

______________________________________________________________________

### filterableProperties?

> `optional` **filterableProperties**: [`FilterableProperty`](../../type-aliases/FilterableProperty/)[]

Defined in: [schema.ts:1161](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1161)

A list of properties from within [ObjectSchemaDefinition.properties](../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`](../../type-aliases/IndexedProperty/)[]

Defined in: [schema.ts:1191](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1191)

A list of properties from within [ObjectSchemaDefinition.properties](../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 = sdk.makeObjectSchema({
  properties: {
    // ...
    specSheetLink: {
      type: sdk.ValueType.String,
      codaType: sdk.ValueHintType.Attachment,
      description: "Link the PDF spec sheet for the product.",
    },
  },
  // ...
  index: {
    properties: ["specSheetLink"],
  },
});
```
