Metadata field schema definition for proper indexing.
Defines how individual metadata fields should be indexed in Redis. Each field can have a specific type (tag, text, numeric, geo) and type-specific options.
Note: For timestamp fields, use type "numeric" and store values as Unix epoch timestamps. The serialization/deserialization utilities will automatically handle Date object conversion.
interface MetadataFieldSchemaconst schema: MetadataFieldSchema[] = [
{ name: "category", type: "tag", options: { separator: "," } },
{ name: "price", type: "numeric", options: { sortable: true } },
{ name: "description", type: "text", options: { weight: 2.0 } },
{ name: "location", type: "geo" },
{ name: "created_at", type: "numeric", options: { sortable: true } } // For timestamps
];Field name in the metadata
Additional field options
Field type for indexing.