Santiago Muñoz
04/01/2024, 6:04 PMlet schema = {
name: 'definitions_test',
fields: [
{
name: 'id',
type: 'string',
facet: true,
},
{
name: 'subcategory',
type: 'string',
facet: true,
},
{
name: 'name',
type: 'string',
facet: true,
// optional: true,
},
{
name: 'description',
type: 'string',
facet: true,
// optional: true,
},
{
name: 'definition',
type: 'string',
facet: true,
// optional: true,
},
{
name: 'dispositions',
type: 'string[]',
facet: true,
// optional: true,
},
{
name: 'notes',
type: 'string[]',
facet: true,
// optional: true,
},
{
name: 'decree',
type: 'object[]',
facet: true,
},
{
name: 'embedding',
type: 'float[]',
embed: {
from: [
"id",
"subcategory",
// "name",
// "description",
// "definition",
// "notes"
],
model_config: {
model_name: "ts/all-MiniLM-L12-v2"
// model_name: "ts/e5-small"
}
}
}
],
enable_nested_fields: true
}
When I try to import data to the schema, an error appears with the following stacktrace:
RequestMalformed: Request failed with HTTP code 400 | Server said: Field `embedding` has invalid fields to create embeddings from.
at RequestMalformed.TypesenseError [as constructor] (/Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/Errors/TypesenseError.js:23:28)
at new RequestMalformed (/Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/Errors/RequestMalformed.js:25:42)
at ApiCall.customErrorForResponse (/Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/ApiCall.js:361:21)
at /Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/ApiCall.js:220:98
at step (/Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/ApiCall.js:33:23)
at Object.next (/Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/ApiCall.js:14:53)
at step (/Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/ApiCall.js:18:139)
at Object.next (/Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/ApiCall.js:14:53)
at fulfilled (/Users/mythologylabs/Documents/Pruebas/typesense/node_modules/typesense/lib/Typesense/ApiCall.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
httpStatus: 400
}
Does someone know what is going on?
I’m running typesense 0.25.2 with the official Docker image