I am trying to implement the Algolia search. I am using PHP.
Scenario: I have three tables (products, resources, and news). I am currently using MultipleQueries (DOCs Link Here) from this documentation.
As a result, I am getting results in the following format as in the documentation.
{
"results": [
{
"hits": [
{
........
},
],
"page": 0,
"nbHits": 1,
"nbPages": 1,
"hitsPerPage": 20,
"processingTimeMS": 1,
"query": "jimmie paint",
"params": "query=jimmie+paint&attributesToRetrieve=firstname,lastname&hitsPerPage=50"
"index": "people"
},
{
"hits": [
{
...........
},
{
...........
}
],
"page": 0,
"nbHits": 1,
"nbPages": 1,
"hitsPerPage": 20,
"processingTimeMS": 1,
"query": "jimmie paint",
"params": "query=jimmie+paint&attributesToRetrieve=firstname,lastname&hitsPerPage=50"
"index": "famous_people"
},
{
..............
}
]
}
This is great, but WHAT I WANT is to group the results of 3 indices into single hits. Below is a sample I am expecting from the API.
{
"results": [
{
"hits": [
{
........
},
{
........
},
{
........
},
{
........
},
{
........
},
{
........
},
{
........
},
],
"page": 0,
"nbHits": 1,
"nbPages": 1,
"hitsPerPage": 20,
"processingTimeMS": 1,
"query": "jimmie paint",
"params": "query=jimmie+paint&attributesToRetrieve=firstname,lastname&hitsPerPage=50"
"index": "indices goes here"
},
]
}
I searched a lot but could not come with suitable solution. Is this even possible using Algolia. Any help would be greatly appreciated. Thank you in advance.