younifyd
Menu

Create a new collection

Create a new collection

POST/collections

Use it in a workflow

  1. Add a step and choose the Typesense connector.
  2. Pick the Create a new collection action (under collections).
  3. Fill in the fields below, then reference the result from later steps as {{createANewCollection.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

namestringrequired

Name of the collection

fieldsarray<object>required

A list of fields for querying, filtering and faceting

namestringrequired
typestringrequired
optionalboolean
facetboolean
indexboolean

Default true

localestring
sortboolean
infixboolean

Default false

referencestring

Name of a field in another collection that should be linked to this collection so that it can be joined during query.

async_referenceboolean

Allow documents to be indexed successfully even when the referenced document doesn't exist yet.

num_diminteger
dropboolean
storeboolean

When set to false, the field value will not be stored on disk. Default: true.

vec_diststring

The distance metric to be used for vector search. Default: `cosine`. You can also use `ip` for inner product.

range_indexboolean

Enables an index optimized for range filtering on numerical fields (e.g. rating:>3.5). Default: false.

stemboolean

Values are stemmed before indexing in-memory. Default: false.

stem_dictionarystring

Name of the stemming dictionary to use for this field

token_separatorsarray<string>

List of symbols or special characters to be used for splitting the text into individual words in addition to space and new-line characters.

Default []

symbols_to_indexarray<string>

List of symbols or special characters to be indexed.

Default []

embedobject2 fields
default_sorting_fieldstring

The name of an int32 / float field that determines the order in which the search results are ranked when a sort_by clause is not provided during searching. This field must indicate some kind of popularity.

Default ""

token_separatorsarray<string>

List of symbols or special characters to be used for splitting the text into individual words in addition to space and new-line characters.

Default []

synonym_setsarray<string>

List of synonym set names to associate with this collection

enable_nested_fieldsboolean

Enables experimental support at a collection level for nested object or object array fields. This field is only available if the Typesense server is version `0.24.0.rcn34` or later.

Default false

symbols_to_indexarray<string>

List of symbols or special characters to be indexed.

Default []

voice_query_modelobject

Configuration for the voice query model

model_namestring
metadataobject

Optional details about the collection, e.g., when it was created, who created it etc.

json
{
  "name": "companies",
  "fields": [
    {
      "name": "num_employees",
      "type": "int32",
      "facet": false
    },
    {
      "name": "company_name",
      "type": "string",
      "facet": false
    },
    {
      "name": "country",
      "type": "string",
      "facet": true
    }
  ],
  "default_sorting_field": "num_employees",
  "token_separators": [],
  "synonym_sets": [
    "synonym_set_1"
  ],
  "enable_nested_fields": true,
  "symbols_to_index": [],
  "voice_query_model": {
    "model_name": "ts/whisper/base.en"
  },
  "metadata": {}
}

Response

Returns 201 with a any. Read it in later steps with {{createANewCollection.response.data.<field>}}.

Need more? See the Typesense guide for connection setup and behaviour shared by every action.