I am working on search API. Currently I am havinng 3 filter i.e. author, publish date, topic.
Now I have created a Search API along with paginantion. based on request data it provides result (default page size is 10 for pagination).
Now I want to acheive following.
Whenver I change any of the filter, other filters should contain only valid values.
e.g. if I search with Author=XYZ then the publish date and topic filters should have only valid possible values for Author XYZ.
In other words publish date and topic filter will have values which are related to Author XYZ.
As I am having pagination, how should I check all the related fields everytime some filter values changed.
what should be the optimize code flow for the same ??