I am implementing Google Retail AI and its Search service to my flutter application.
I want to let users search by typing keywords in the search bar and then get the first page of results and a whole set of facets, which helps them do further filtering or something else.
For example, if a user types "black" and then searches, there would be nearly hundreds of results. Then the first page of results would be returned to this user and the facets data returned would be used to build as a filter for a user to use, such as select brand for further filtering.
I know how to use facets key and value to perform a facets search, but I do not know how to get the facets data from the initial search to build the facets filter.
The image is above from google retail console, I want to build the same thing in my application.
I thought to get all products first, then use the results with group by to build this filter, but it is against the pagination, and it is absolutely not a good solution.
Does anyone have any ideas or suggestions for retrieving the facets data? L:3, Any idea related to google retail search auto-completion are also welcomed.
After few days of research, I find that the FacetSpec field in the search request is used to get the data to build filter for facet search