Scott Nei
03/12/2025, 3:55 PM{u'message': u'2499 documents imported successfully, 1 documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document.', u'name': u'Error', u'stack': u'Error: 2499 documents imported successfully, 1 documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document.\n at TypesenseService.importDocumentsInJsonFormat (webpack-internal:///422:362:13)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)\n at ProductSearchAreaService.updateDocuments (webpack-internal:///426:188:37)\n at ProductSearchAreaService.updateAllCollections (webpack-internal:///221:103:11)\n at ProductSearchAreaService.syncAll (webpack-internal:///221:41:5)\n at ScheduledTaskService.processTask (webpack-internal:///540:310:22)'}
And using the 'error.importResults' we see this error detail:
{
"code": 400,
"error": "`productPrices_prod_1.0.productId` does not have a reference to `products_prod_1.0` collection.",
"success": false
}
My understanding was that the async_reference: true setting would prevent this error. But also concerning, is the fact that we can't query, update, delete, or create a record for that ID. See the attached screenshots. Is this a bug in the async_reference option just released?Fanis Tharropoulos
03/12/2025, 4:11 PMFanis Tharropoulos
03/12/2025, 4:14 PM_
) vs using dots for the semantic versioning? Since dots are used for denoting child fields on references, that may be at play hereScott Nei
03/12/2025, 4:25 PMScott Nei
03/12/2025, 6:06 PMJason Bosco
03/13/2025, 8:48 PMScott Nei
03/14/2025, 12:06 AMScott Nei
03/14/2025, 12:10 AMScott Nei
03/14/2025, 3:05 PMHarpreet Sangar
03/14/2025, 3:18 PMHarpreet Sangar
04/15/2025, 7:25 PMScott Nei
04/17/2025, 12:15 AMHarpreet Sangar
04/18/2025, 7:00 AMasync_reference
being stuck due to a deadlock. I think what you're describing isn't related to that issue.
We just switched to using names without dotsSince we support referencing the object fields that have field name like
object_name.field_name
, it can interfere with the parsing logic if the collection name has dots in its name itself. So if you mention "reference": "productPrices_prod_1.0.productId"
it'll be parsed as collection: productPrices_prod_1
and field: 0.productId
.
Regarding using alias name in reference
property, the join will only work till you don't update the the aliased collection. The reason for this behaviour is that the references are static to achieve better query response time. By static I mean that we store the internal id of the referenced document in the document that references it. So when the referenced collection is updated, the references might break.
I'll suggest setting up aliases only for querying purpose and treating the referenced and referencing collection as a group.
https://typesense.org/docs/28.0/api/joins.html#using-aliases-with-joinsHarpreet Sangar
04/18/2025, 7:03 AMSo when the referenced collection is updated, the references might break.To clarify, updating individual fields of referenced documents won't break the references but deleting certain document and re-indexing will.