Lucas Rahn
02/26/2025, 8:30 PMconst searchParams = {
q: searchText === "" ? "*" : searchText,
query_by: "title,description",
exclude_fields: "embedding",
page: 1,
per_page: 16,
include_fields: "$marketplaces(*)",
};
const results = await typesense.collections("items").documents().search(searchParams);
console.log(results);
and here is the relevant part of my schema:
export const itemSESchema: CollectionCreateSchema = {
name: "items",
enable_nested_fields: true,
fields: [
// marketplace fields
{
name: "marketplaceId",
type: "string",
reference: "marketplaces.id",
},
but this is my return result:
{
"basePrice": 199.75,
"category": "Special Event and Party",
"createdAt": 1740586782838,
"description": "Make sure this fits by entering your model number. | SERPENTINE DESIGN: Allows Magic Tracks to bend, flex, and curve in any direction",
"id": "itm-157d5-613e08-0b77",
"images": [
{
"id": "fil-7d71685-7de6682b-be2354",
"url": "<https://images-na.ssl-images-amazon.com/images/I/61DMdeT-7hL.jpg>"
},
{
"id": "fil-637909c-529f5a5f-cfeb2c",
"url": "<https://images-na.ssl-images-amazon.com/images/I/519AkYDZmVL.jpg>"
},
],
"marketplaceId": "mkp-95f4d-ffaf04-31ab",
"nonAvailability": [],
"quantity": 2,
"status": "active",
"tags": [],
"title": "Ontel Magic Tracks The Amazing Racetrack That Can Bend, Flex and Glow - As Seen On TV",
"updatedAt": 1740586782838
}
it does not include marketplaces: {//… data}. Im not really sure what im doing wrong since i know for sure that there is a marketplaces document with such id. what does it mean if the marketplaces field is just not included?