Query data based on a common value before searching?

For some reason I’m having a hard time finding an answer to this question. How can I query my index based on a common value and then search that data. Example:

{
  name: "John Smith",
  age 24
},
{
  name: "John Smith",
  age 55
},
{
  name: "Tom Adams",
  age 37
}

I would want to query all John Smiths and then search age. I’m doing this in Angular btw.

Thanks in advance!

Nevermind I figured out I had to setup a facet