vectorIndexType: "flat" unrecognized

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

hi @KP_KP !

Welcome to our community :hugs:

Can you provide a code for that?

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

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:

{'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!