# Bug creating named vectors using REST Api

**URL:** <https://forum.weaviate.io/t/bug-creating-named-vectors-using-rest-api/2906>\
**Category:** General\
**Tags:** bug\
**Created:** [July 2, 2024, 3:07pm UTC](https://forum.weaviate.io/t/bug-creating-named-vectors-using-rest-api/2906 "2024-07-02T15:07:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cameronmccord2](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/cameronmccord2/32/1867_2.png) [@cameronmccord2](https://forum.weaviate.io/u/cameronmccord2)\
**Post date:** [July 2, 2024, 3:07pm UTC](https://forum.weaviate.io/t/bug-creating-named-vectors-using-rest-api/2906/1 "2024-07-02T15:07:17Z")

</div>

Found a bug when creating a schema with a named vector using the REST api.

Bug:

The documentation indicates that “vectorIndexType” defaults to “hnsw” but the creation fails if that key and value aren’t explicitly specified. See Body Parameters → objectClass → vectorConfig → \<vector\_name\> → vectorIndexType at [Weaviate - Vector Database](https://weaviate.io/developers/weaviate/api/rest#tag/schema/post/schema)

Expected result: the collection schema gets created without having to specify vectorIndexType

Actual result: JSON error

```json
[{"error":[{"message":"target vector \"text\": unrecognized or unsupported vectorIndexType \"\""}]}]

```

Failing input:

```json
{
  "class": "Question",
  "description": "Table index for the Question collection",
  "moduleConfig": {
    "text2vec-ollama": {
      "apiEndpoint": "http://host.docker.internal:11434",
      "model": "mxbai-embed-large",
      "vectorizeClassName": false
    }
  },
  "properties": [
    {
      "dataType": [
        "text"
      ],
      "description": "The text column",
      "name": "text",
      "indexFilterable": false,
      "indexSearchable": false
    },
    {
      "dataType": [
        "text"
      ],
      "description": "Our uid of the record in mysql",
      "indexFilterable": true,
      "indexSearchable": false,
      "name": "uid"
    }
  ],
  "vectorConfig": {
    "text": {
      "vectorizer": {
        "text2vec-ollama": {
          "properties": [
            "text"
          ]
        }
      }
    }
  }
}

```

Working input: (only change is the addition of the key `vectorConfig.text.vectorIndexType`

```json
{
  "class": "Question",
  "description": "Table index for the Question collection",
  "moduleConfig": {
    "text2vec-ollama": {
      "apiEndpoint": "http://host.docker.internal:11434",
      "model": "mxbai-embed-large",
      "vectorizeClassName": false
    }
  },
  "properties": [
    {
      "dataType": [
        "text"
      ],
      "description": "The text column",
      "name": "text",
      "indexFilterable": false,
      "indexSearchable": false
    },
    {
      "dataType": [
        "text"
      ],
      "description": "Our uid of the record in mysql",
      "indexFilterable": true,
      "indexSearchable": false,
      "name": "uid"
    }
  ],
  "vectorConfig": {
    "text": {
      "vectorIndexType": "hnsw",
      "vectorizer": {
        "text2vec-ollama": {
          "properties": [
            "text"
          ]
        }
      }
    }
  }
}

```

We’re using Weaviate via Docker `cr.weaviate.io/semitechnologies/weaviate:1.25.4`  
We’re using [weaviate-ruby](https://github.com/patterns-ai-core/weaviate-ruby) but its a light wrapper that passes this json through to your REST Api

The product works great! Thanks

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [July 3, 2024, 1:17pm UTC](https://forum.weaviate.io/t/bug-creating-named-vectors-using-rest-api/2906/2 "2024-07-03T13:17:15Z")

</div>

Hi @cameronmccord2

Thank you for the report! That is interesting. It may be a bug - I can confirm that I can reproduce it, and I don’t think that is intended behaviour.

I have passed it on to the team and we will get back to you shortly.

Best,  
JP
