Slackbot
11/09/2023, 2:13 PMNikhil Agarwal
11/09/2023, 8:55 PMJason Bosco
11/09/2023, 8:58 PMid field in the docs, this is what that ID refers to. If you don't set one, it is automatically generated by Typesense.
If you didn't set an id field explicitly, you could do something like GET /collections/name/documents/id (where id would be 996 in your case) to get the document that that ID refers toJason Bosco
11/09/2023, 8:58 PMIs there a way for me to ignore a missing reference?There is no way to do this at the moment
Nikhil Agarwal
11/09/2023, 9:01 PMNikhil Agarwal
11/09/2023, 9:02 PMid looks like this:-Jason Bosco
11/09/2023, 9:04 PMcategories collection?Nikhil Agarwal
11/09/2023, 9:04 PMNikhil Agarwal
11/09/2023, 9:05 PMJason Bosco
11/09/2023, 9:05 PMNikhil Agarwal
11/09/2023, 9:05 PMJason Bosco
11/09/2023, 9:06 PMNikhil Agarwal
11/09/2023, 9:07 PMconst itemsCollectionSchemaFields: CollectionCreateSchema["fields"] = [
{ name: "id", type: "string", index: true, optional: false, sort: true, infix: true, facet: true },
{ name: "_id", type: "string", index: true, optional: false, sort: false, infix: false },
{ name: "commodityId", type: "string", index: true, optional: true, sort: false, infix: false, facet: true, reference: "commodities.id" }
];Nikhil Agarwal
11/09/2023, 9:07 PMconst commoditiesCollectionCreateSchema: CollectionCreateSchema["fields"] = [
{ name: "id", type: "string", index: true, optional: false, sort: false, infix: false }, // commodityId
{ name: "description", type: "string", index: true, optional: false, sort: true, infix: false },
{ name: "active", type: "bool", index: true, optional: false, sort: false, infix: false }, // useful for deleting all documents
];Jason Bosco
11/09/2023, 9:15 PM$categories... could you share that collection's schema?Nikhil Agarwal
11/09/2023, 9:16 PMJason Bosco
11/09/2023, 9:17 PMNikhil Agarwal
11/09/2023, 9:17 PMNikhil Agarwal
11/09/2023, 9:18 PMJason Bosco
11/09/2023, 9:19 PMid is a special field... If that's the issue, we can try addressing thatJason Bosco
11/09/2023, 9:19 PMNikhil Agarwal
11/09/2023, 9:19 PMNikhil Agarwal
11/09/2023, 10:08 PMcommodityIdNikhil Agarwal
11/09/2023, 10:10 PMJason Bosco
11/09/2023, 11:06 PMJason Bosco
11/09/2023, 11:06 PMNikhil Agarwal
11/10/2023, 9:06 AMHarpreet Sangar
11/10/2023, 9:15 AMHarpreet Sangar
11/10/2023, 9:38 AM{ name: "commodityId", type: "string", index: true, optional: true, sort: false, infix: false, facet: true, reference: "commodities.id" }
and when we try to compute the sort score of a document that doesn't have a reference on the basis of $commodities(description:asc), it returns this error.Nikhil Agarwal
11/10/2023, 9:41 AMNikhil Agarwal
11/10/2023, 10:11 AMcommodityId instead. But I am concerned that next import would duplicate the valuesHarpreet Sangar
11/10/2023, 10:16 AMHarpreet Sangar
11/10/2023, 10:18 AMNikhil Agarwal
11/10/2023, 12:21 PMdescription field, can there be an issue with sorting by both the props? In this case I am trying to sort by commodity description and then item description. However items are not getting sorted even though commodities areHarpreet Sangar
11/10/2023, 12:23 PMHarpreet Sangar
11/10/2023, 12:25 PMNikhil Agarwal
11/10/2023, 12:27 PMNikhil Agarwal
11/10/2023, 12:28 PMHarpreet Sangar
11/10/2023, 12:32 PMNikhil Agarwal
11/10/2023, 12:52 PMHarpreet Sangar
11/10/2023, 12:53 PMNikhil Agarwal
11/10/2023, 12:56 PMNikhil Agarwal
11/10/2023, 1:02 PMHarpreet Sangar
11/14/2023, 9:32 AMNikhil Agarwal
11/14/2023, 10:40 AM