Storefront GraphQL search query with productFilters not working

When i try the following query:

query searchWithFilters($query: String!, $first: Int, $productFilters: [ProductFilter!]) {
search(query: $query, first: $first, productFilters: $productFilters) {
edges {
node {
... on Product {
handle
}
}
}
}
}

With the following variables:

{ "query": "", "first": 100, "productFilters": [{'productMetafield':{"namespace": "mynamespace", "key": "mykey", "value": "myvalue"}}] }

I am getting back 100 products vs the expected 2 that have product metafields with the namespace mynamespace, the key mykey and the value myvalue

For each of my product metafields i have defined, i have turned on:

“Filter in product index” - Adds definition to the filter options in the product index

Why does the query not filter the results?

SOLVED
I had to install the Search and Discovery App, and setup the appropriate filters before this query would work.

Also solved with this method. I think this should be better explained in the docs. I’m using version 2024-07