Typesense · Schema

Field

Full-Text SearchOpen SourceSearch EngineTypo ToleranceVector Search

Properties

Name Type Description
name string Name of the field.
type string Data type of the field. Supported types include string, int32, int64, float, bool, string[], int32[], int64[], float[], bool[], auto, object, object[], geopoint, geopoint[], image.
optional boolean Whether this field is optional in documents.
facet boolean Whether this field can be used for faceting.
index boolean Whether this field should be indexed for search.
sort boolean Whether this field can be used for sorting.
infix boolean Whether infix search is enabled for this field.
locale string Locale for language-specific tokenization.
reference string Reference to a field in another collection for JOINs.
num_dim integer Number of dimensions for vector fields.
store boolean Whether to store the field value for retrieval.
range_index boolean Whether to build a range index for this field.
stem boolean Whether stemming is enabled for this field.
stem_dictionary string Name of the custom stemming dictionary to use.
drop boolean Whether to drop this field during a schema update.
vec_dist string Distance metric for vector fields.
embed object Embedding configuration for auto-generating vector embeddings.
View JSON Schema on GitHub

JSON Schema

typesense-field-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Field",
  "title": "Field",
  "type": "object",
  "required": [
    "name",
    "type"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the field."
    },
    "type": {
      "type": "string",
      "description": "Data type of the field. Supported types include string, int32, int64, float, bool, string[], int32[], int64[], float[], bool[], auto, object, object[], geopoint, geopoint[], image.",
      "enum": [
        "string",
        "int32",
        "int64",
        "float",
        "bool",
        "string[]",
        "int32[]",
        "int64[]",
        "float[]",
        "bool[]",
        "auto",
        "object",
        "object[]",
        "geopoint",
        "geopoint[]",
        "image"
      ]
    },
    "optional": {
      "type": "boolean",
      "description": "Whether this field is optional in documents."
    },
    "facet": {
      "type": "boolean",
      "description": "Whether this field can be used for faceting."
    },
    "index": {
      "type": "boolean",
      "description": "Whether this field should be indexed for search."
    },
    "sort": {
      "type": "boolean",
      "description": "Whether this field can be used for sorting."
    },
    "infix": {
      "type": "boolean",
      "description": "Whether infix search is enabled for this field."
    },
    "locale": {
      "type": "string",
      "description": "Locale for language-specific tokenization."
    },
    "reference": {
      "type": "string",
      "description": "Reference to a field in another collection for JOINs."
    },
    "num_dim": {
      "type": "integer",
      "description": "Number of dimensions for vector fields."
    },
    "store": {
      "type": "boolean",
      "description": "Whether to store the field value for retrieval."
    },
    "range_index": {
      "type": "boolean",
      "description": "Whether to build a range index for this field."
    },
    "stem": {
      "type": "boolean",
      "description": "Whether stemming is enabled for this field."
    },
    "stem_dictionary": {
      "type": "string",
      "description": "Name of the custom stemming dictionary to use."
    },
    "drop": {
      "type": "boolean",
      "description": "Whether to drop this field during a schema update."
    },
    "vec_dist": {
      "type": "string",
      "description": "Distance metric for vector fields.",
      "enum": [
        "cosine",
        "ip"
      ]
    },
    "embed": {
      "type": "object",
      "description": "Embedding configuration for auto-generating vector embeddings.",
      "properties": {
        "from": {
          "type": "array",
          "description": "Field names to generate embeddings from.",
          "items": {
            "type": "string"
          }
        },
        "model_config": {
          "type": "object",
          "description": "Model configuration for embedding generation.",
          "properties": {
            "model_name": {
              "type": "string",
              "description": "Name of the embedding model."
            },
            "api_key": {
              "type": "string",
              "description": "API key for external embedding services."
            },
            "url": {
              "type": "string",
              "description": "URL of the embedding service."
            }
          }
        }
      }
    }
  }
}