Multiple queries and result for same index if selected multiple facets

Hi,

I am looking at the requests and response objects of the search method.
I found that when I filtered by two facets, there will be three queries in the requests object:

but having the same indexName.

In the resposne there are three results accordingly:

my question is, are the second and third items in the requests necessary?

If i use the searchclient directly to query the data with multiple facets, is it OK only pass in the first one,

Thanks.

Hi there,

The reason why there are multiple queries is because the queries are of different types. There is one regular query and two facet queries. The two facets queries are there to fetch the facet counts respective of the other facet filter, as well as the available filters.

You can not pass these queries but this means that your filters will not be updated based on the query and that you may offer filters that do not match any possible results anymore based on the current combination of already applied filters.

Let me know if that answered your question.
Best,