Search films and actors as one
This is the step that makes the finished example possible. You have two lists; a visitor doesn't think in lists. They type one thing into one box and expect the right answer back, film or person. A group gives you exactly that.
What a group is
A group is a single searchable thing made of several lists. Search it, and Search Stack searches every list in the group, merges the matches, and ranks them together, so "hemsworth" can return both the actor and the films they're in, in one response. Your underlying lists don't change; the group just gives them a shared front door.
Create the group
Go to Groups and choose Create Group. Name it movies-and-actors.
Open the new group's menu and choose Add List. Add movies, then do the same for actors. Each list is added at a specific version, so the group always searches a known shape of each list:
The group now lists both members:
Search the group
A group has its own search and suggest endpoints: same as a list, with group in the path. The number is the group's current version, shown next to it in the console:
GET https://api.searchstack.dev/search/group/Demo/movies-and-actors/3?query=hemsworth
X-API-Key: {your key}
Results come back merged from both lists. Each result carries a list_name telling you which list it came from, so your page can show a film with a poster and a person with a headshot, from the same response:
{
"results": [
{ "name": "Liam Hemsworth", "list_name": "actors", "fields": { "movies": ["The Hunger Games: Catching Fire"] } },
{ "name": "The Dark Knight", "list_name": "movies", "fields": { "genre": "Action", "year": 2008 } }
],
"count": 2,
"total_count": 2
}
In your front-end you'd branch on list_name to pick the right card template:
if (result.list_name === "actors") {
renderActorCard(result); // headshot + films
} else {
renderMovieCard(result); // poster + year
}
Why versions are pinned
Because each list joins the group at a fixed version, changing a list later never silently breaks the group. When you're ready to pick up a list's changes, you bump the group to a new version on your own schedule. That's the same versioning idea the last step of this lesson meets head-on.
Go deeper: Merging behaviour, version pins and cloning in the reference.