Hello everyone, When I try to update a collection ...
# community-help
n
Hello everyone, When I try to update a collection schema, it does not work, and it gives me this error: It does not work until I delete the whole collection and create it with the new fields. Is there a way that I can update an existing collection's schema without deleting it?
f
Hey Nooraldeen. Could you share the Update's request Body and your Typesense version?
n
Copy code
{
  "name": "products",
  "fields": [
    {
      "name": "quantity",
      "type": "int32",
      "facet": false,
      "optional": true,
      "index": false,
      "sort": false,
      "infix": false,
      "locale": ""
    },
    {
      "name": "source_url",
      "type": "string",
      "facet": false,
      "optional": true,
      "index": false,
      "sort": false,
      "infix": false,
      "locale": ""
    },
    {
      "name": "name_en",
      "type": "string",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": true,
      "locale": "en"
    },
    {
      "name": "description_en",
      "type": "string",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": true,
      "locale": "en"
    },
    {
      "name": "summary_en",
      "type": "string",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": true,
      "locale": "en"
    },
    {
      "name": "name_ar",
      "type": "string",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": true,
      "locale": "ar"
    },
    {
      "name": "description_ar",
      "type": "string",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": true,
      "locale": "ar"
    },
    {
      "name": "summary_ar",
      "type": "string",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": true,
      "locale": "ar"
    },
    {
      "name": "thumbnail",
      "type": "string",
      "facet": false,
      "optional": true,
      "index": false,
      "sort": false,
      "infix": false,
      "locale": ""
    },
    {
      "name": "store_id",
      "type": "string",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": false,
      "locale": ""
    },
    {
      "name": "created_at",
      "type": "string",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": false,
      "locale": ""
    },
    {
      "name": "embedding_en",
      "type": "float[]",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": false,
      "locale": "",
      "embed": {
        "from": [
          "name_en",
          "description_en",
          "summary_en"
        ],
        "model_config": {
          "model_name": "ts/e5-small"
        }
      },
      "num_dim": 384
    },
    {
      "name": "embedding_ar",
      "type": "float[]",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": false,
      "locale": "",
      "embed": {
        "from": [
          "name_ar",
          "description_ar",
          "summary_ar"
        ],
        "model_config": {
          "model_name": "ts/e5-small"
        }
      },
      "num_dim": 384
    },
    {
      "name": "price_SAR",
      "type": "int32",
      "facet": false,
      "optional": false,
      "index": true,
      "sort": false,
      "infix": false,
      "locale": ""
    }
  ],
  "default_sorting_field": "",
  "enable_nested_fields": false,
  "symbols_to_index": [],
  "token_separators": []
}
It's actually annoying to update a collection scheme, like first when I created it with the embedding fields, no errors occured, but when I want to add a new field, like "store_status", the error I sent above shows up
f
Hey Nooraldeen, This seems like the collection's schema. What I was referring to was the update request
n
Im using Typesense Dashboard (hosted locally), there's a UI for it and I can update the sceheme from there, is that your question?
f
To eliminate any potential issues stemming from the Typesense Dashboard, could you try updating using curl? And if you could, could you create a reproducible example similar to this one, so we can debug?
n
thanks, I tried with curl, and it worked
🎉 1