Typesense icon

Typesense

Interact with the Typesense search platform

Collection → Update

AI-generated

Overview

This node updates an existing collection in a Typesense instance. It allows users to modify the collection schema either by providing raw JSON or by specifying individual schema fields and options. This is useful for managing and evolving search collections dynamically, such as adding new fields, changing field types, or adjusting indexing options.

Use Case Examples

  1. Updating a collection schema to add a new searchable field.
  2. Changing the default sorting field of a collection.
  3. Enabling nested fields in a collection schema.

Properties

Name Meaning
Collection Name Selects the collection to update from the Typesense instance.
JSON Parameters Determines whether the collection schema is provided as raw JSON or through structured fields.
Collection Schema (JSON) Raw JSON representation of the collection schema, used if JSON Parameters is true.
Collection Schema Structured collection schema fields and options, used if JSON Parameters is false.
Additional Options Additional collection update options such as default sorting field, token separators, symbols to index, and metadata in JSON format.

Output

JSON

  • collectionName - Name of the updated collection.
  • schema - Updated schema details of the collection.
  • fields - List of fields in the updated collection schema.
  • defaultSortingField - Field used for default sorting after update.
  • metadata - Metadata associated with the updated collection.

Dependencies

  • Requires a Typesense API key credential to authenticate requests to the Typesense instance.

Troubleshooting

  • Error loading collections or fields usually indicates connectivity or authentication issues with the Typesense instance. Verify API credentials and network access.
  • Providing invalid JSON in the Collection Schema (JSON) field can cause parsing errors. Ensure JSON is well-formed.
  • Selecting a collection that does not exist or has been deleted will result in errors. Confirm the collection exists before updating.
  • If the node throws an error about unsupported resources, ensure the resource parameter is set correctly to 'collection'.

Discussion