Here is what my data looks like:
Store Index
{
"store_id": integer,
"store_name": string,
"address": text
}
Product Index
{
"product_id": integer,
"product_name": string,
"product_sku": string,
"store_id" : integer,
"store_name" : string
}
I've already tried to bring the store and products but separately. Have used alias for common fields too to get store and product names. There is also a problem that the search query is also applied on SKUs which I do not want.
What I'am expecting is a query which brings the aggregated store as well as the products in single hit. Which may look like below:
Expected Results (Rough Idea)
{
"results": [
{
"type": "store",
"name": "Some chicken store",
"latest_SKUs": ["45345435435", "5654645645"]
},
{
"type": "product",
"name": "Spicy Nuggets",
"latest_SKUs": ["4asda5435435"] //Only single SKU in case of products
},
{
"type": "store",
"name": "Shoe Store",
"latest_SKUs": ["46621278136", "613187979"]
}
]
}