# vectorIndexType: "flat" unrecognized

**URL:** <https://forum.weaviate.io/t/vectorindextype-flat-unrecognized/2461>\
**Category:** Support\
**Tags:** bug\
**Created:** [May 24, 2024, 12:49pm UTC](https://forum.weaviate.io/t/vectorindextype-flat-unrecognized/2461 "2024-05-24T12:49:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KP\_KP](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/kp_kp/32/1577_2.png) [@KP\_KP](https://forum.weaviate.io/u/KP_KP)\
**Post date:** [May 24, 2024, 12:49pm UTC](https://forum.weaviate.io/t/vectorindextype-flat-unrecognized/2461/1 "2024-05-24T12:49:17Z")

</div>

Hello,

Whilst creating collection I am unable to set the “vectorIndexType” to “flat”.

It seems only hnsw works as expected.

When running the following schema, code works as expected:

schema = {  
“class”: “ExampleClass”,  
“vectorizer”: ‘text2vec-openai’,  
“description”: “descr of the class”,  
“moduleConfig”: {  
“text2vec-contextionary”: {  
“vectorizeClassName”: True  
}  
},  
“vectorIndexType”: “hnsw”,  
“properties”: [  
{  
“dataType”: [  
“text”  
],  
“description”: “examplecontent”,  
“name”: “text”,  
“moduleConfig”: {  
“text2vec-openai”: {  
“vectorizePropertyName”: False,  
“skip” : True  
}  
}  
}  
]  
}

However, when running this:

schema = {  
“class”: “ExampleClass”,  
“vectorizer”: ‘text2vec-openai’,  
“description”: “descr of the class”,  
“moduleConfig”: {  
“text2vec-contextionary”: {  
“vectorizeClassName”: True  
}  
},  
“vectorIndexType”: “flat”,  
“properties”: [  
{  
“dataType”: [  
“text”  
],  
“description”: “examplecontent”,  
“name”: “text”,  
“moduleConfig”: {  
“text2vec-openai”: {  
“vectorizePropertyName”: False,  
“skip” : True  
}  
}  
}  
]  
}

I receive the following response:

weaviate.exceptions.UnexpectedStatusCodeError: Create class! Unexpected status code: 422, with response body: {‘error’: [{‘message’: ‘unrecognized or unsupported vectorIndexType “flat”’}]}.

Could you please help out?

With Regards  
Konrad

### Server Setup Information

- Weaviate Server Version: 4.5.4
- Deployment Method: docker
- Number of Running Nodes: 1
- Client Language and Version: Python v3

### Any additional Information

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [May 28, 2024, 12:55pm UTC](https://forum.weaviate.io/t/vectorindextype-flat-unrecognized/2461/2 "2024-05-28T12:55:20Z")

</div>

hi @KP_KP !

Welcome to our community 🤗

Can you provide a code for that?

This is how you can do using the new python v4 client:

```auto
from weaviate import classes as wvc
col = client.collections.create(
    "Test",
    vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_openai(),
    vector_index_config=wvc.config.Configure.VectorIndex.flat()
)

```

and this is the resulting json:

```auto
{'invertedIndexConfig': {'bm25': {'b': 0.75, 'k1': 1.2},
  'cleanupIntervalSeconds': 60,
  'indexNullState': False,
  'indexPropertyLength': False,
  'indexTimestamps': False,
  'stopwords': {'preset': 'en'}},
 'multiTenancyConfig': {'enabled': False, 'autoTenantCreation': False},
 'properties': [],
 'replicationConfig': {'factor': 1},
 'shardingConfig': {'virtualPerPhysical': 128,
  'desiredCount': 1,
  'actualCount': 1,
  'desiredVirtualCount': 128,
  'actualVirtualCount': 128,
  'key': '_id',
  'strategy': 'hash',
  'function': 'murmur3'},
 'vectorIndexConfig': {'distanceMetric': 'cosine',
  'vectorCacheMaxObjects': 1000000000000},
 'vectorIndexType': 'flat',
 'vectorizer': 'text2vec-openai',
 'class': 'Test',
 'moduleConfig': {'text2vec-openai': {'baseURL': 'https://api.openai.com',
   'model': 'ada',
   'vectorizeClassName': True}}}

```

Let me know if this helps.

Thanks!
