#community-help

Filtering Ecommerce Search Queries by Store Locations with Available Stock

TLDR Sean wanted to filter search queries by store locations with available stock; Kishore Nallan suggested using an array of store locations and mentioned an upcoming join feature.

Powered by Struct AI

1

3
5mo
Solved
Join the chat
Apr 28, 2023 (5 months ago)
Sean
Photo of md5-aece7b06eda2a85a5bcfb5fd39332e2c
Sean
08:16 AM
Hi all, we have a typical ecommerce product schema and we'd like to be able to filter search queries by store locations with available stock of products returned in the search. Eg we want to be able to search for products which are available in a particular store location by passing in a location identifier into the search query. If it is relevant we have >100 store locations

I'm assuming we could add a field which contains an array of location ID's and stock on hand values for each product? I had a browse of the docs and didn't see anything which resembled what I'd like to do. Just wondering if that is possible and if so, what the best practise is to structure the schema?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:01 AM
👋 if you have the same product across multiple stores, then yes, storing the store locations in an array is the way to go about this. We're also working on a join feature, which will allow you to store the product and store-related attributes in different collections in future and join them during query time. This feature will be available for testing in a month or so.
Sean
Photo of md5-aece7b06eda2a85a5bcfb5fd39332e2c
Sean
09:03 AM
Nice thanks Kishore Nallan, looking forward to the new feature.

1