Request for Simplified Grouping Method with Typesense and Tanstack
TLDR Lalit has a problem with grouping data using Typesense and Tanstack due to nested JSON. They want an alternative method that simplifies the process. Jason has tried to understand the issue but hasn't offered a specific solution.
Aug 14, 2023 (1 month ago)
Lalit
03:00 PMthe issue is that i have to flatten the data and render is there any alternate available ?
Jason
03:00 PMLalit
03:03 PMinside Group_key i am getting the groupped key but it is nested JSON i wanat to render the data from grouping typesense
Lalit
03:03 PMJason
03:07 PMLalit
03:59 PMJason
04:01 PMI’m not sure I understand this part.
The structure of the
highlight
object in the response just follows your document’s original structureLalit
04:17 PMconst variantItems = itemsArray.flatMap(({ variants, itemName, id }) =>
variants?.flatMap(
({
locations,
name: variant,
salesPrice,
purchasePrice,
discountedPrice,
discountedPricePercentage,
}) =>
locations.flatMap(location => ({
id,
itemName,
locationName: location.location.name,
stock: location.currentQuantity,
variant,
salesPrice,
purchasePrice,
discountedPrice,
discountedPricePercentage,
status: 'In-stock',
}))
)
)
this is how i am getting the values to group by from the frontend can i get it with less complexity
Typesense
Indexed 2764 threads (79% resolved)
Similar Threads
Nested Objects Issue in Firebase & Typesense Integration
Shaun encountered issues with nested objects being flattened in Typesense. Jason found the root issue and provided a solution involving updating the Firebase extension to 1.0.3.



Including All Individual Documents in a Group in Typesense
Magnus was uncertain how to include all documents within a group in Typesense, and specifically asked about ecommerce product cards. Jason published a new version of Typesense Instantsearch Adapter and advised storing all variant information for a product on each document. Magnus confirmed this as a viable solution.
Typesense Nested Fields and Sorting Issue
Amrit faced a problem with search response not returning nested objects. Kishore Nallan tried to spot the issue in the schema, but a proper resolution was not reached.
Typesense Server Bulk Import/Upsert Issue Resolved
Adam was confused about the discrepancy between the successful responses and the actual indexed data while working with a custom WP plugin integrating with Typesense. The issue was a bug related to fetching documents in the wrong order, not a Typesense problem.

Troubleshooting 400 Error When Upgrading Typesense Firestore Extension
Orion experienced a `400` error after updating the Typesense Firestore extension, causing issues with cloud functions. They traced the issue back to a data type conflict in their Typesense collection schema after updating. With help from Jason and Kishore Nallan, they resolved the issue by recreating the collection.


