Using filter/facetfilters to only search for a certain attribute and corresponding value

After spending the first half of my day reading trough the docs on filtering and not managing to get a correct filter search query up and running I was wondering if algolias filter/fauce filter even is the correct approach for my use case.

I have a few indices set up for a client and need to narrow down the search results from a single index by attributes such as “type”: “product” or “category”: “Customer Service”.

I did this in the frontend by first fetching the whole index and then manipulating the results until I realized this may cause performance issues. So after looking for a better way i found the filter/faucefilter docs and applied the following code to my search call and added the “type” attribute to my algolia configuration:

searchClient.search(queryArray, {
		facetFilter: ['type:product']
	  }).then((hits) => {
		console.log(hits);
	  });

or alternatively:

searchClient.search(queryArray, {
		filters: 'type:product'
	  }).then((hits) => {
		console.log(hits);
	  });

However this will also retrieve hits with records that don’t have their type set to “product”. (I also have “other” and “photo” in my index records)

So now I’m wondering if I’m doing something wrong or if this approach is wrong as a whole.