Sean Morningstar
10/02/2023, 4:37 AMclient.collections[collName].documents.import_(records, {'action': 'upsert', 'batch_size': 1000})
If I run the script for a minute and stop it after 50,000 documents i see 50,000 records using the retrieve function.
When I add enable_nested_fields: True
to the schema, create a new index and process the same 50,000 records I see a fraction of those listed in the retrieve call ; 'num_documents': 3385
Does my schema look correct?
my_schema = {
"name": collName,
"enable_nested_fields": True,
"fields": [
{
'name' : 'title',
'type' : 'string',
'optional': True
},
{
'name' : 'description',
'type' : 'string',
'optional': True
},
{
'name' : 'product_type',
'type' : 'string',
'facet' : True,
'optional': True
},
{
'name' : 'vendor',
'type' : 'string',
'facet' : True,
'optional': True
},
{
'name' : 'sid',
'type' : 'int64',
'optional': True
},
{
'name' : 'tags',
'type' : 'string[]',
'facet' : True,
'optional': True
},
{
'name' : 'url',
'type' : 'string',
'index': False,
'optional': True
},
{
'name' : 'handle',
'type' : 'string',
'index': False,
'optional': True
},
{
'name' : 'last-updated',
'type' : 'int32',
'optional': True
},
{
'name' : 'missing',
'type' : 'bool',
'optional': True
},
{
"name" : "categories",
"type" : "string[]",
"optional": True
},
{"name": ".*", "type": "auto" }
]
}
client.collections.create(my_schema)