Charter 2 - facetedSearch

I dont´t understand the exercise.
Please, somebody explain me the topic. “facetedSearch”

@Gustavo_Manuel_13807 edit your post and link it to the course so that you can get relevant responses.

Hi @Gustavo_Manuel_13807,

It is very well explained in the Ticket itself:

What is a Faceted Search?

Faceted search is a way of narrowing down search results as search parameters are added. For example, let’s say MFlix allows users to filter movies by a rating from 1 to 10, but Kate Winslet has only acted in movies that have a rating of 6 or higher.

If we didn’t specify any other search parameters, MFlix would allow us to choose a rating between 1 and 10. But if we first search for Kate Winslet, MFlix would only let us choose a rating between 6 and 10, because none of the movie documents in the result set have a rating below 6.

If you’re curious, you can read more about Faceted Search here.

Faceted Search in MFlix

Faceted searches on the MFlix site cannot be supported with the basic search method getMovies , because that method uses the Mongo query language. For faceted searches, the application must use the Aggregation Framework.

The method facetedSearch uses the Aggregation Framework, and the individual stages in the pipeline have already been completed. Follow instructions in the moviesDAO.js file to append the required stages to the pipeline object.

In simple words, you can see it as a nested search filters.