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 ??

Recommended Answers

All 2 Replies

I see you tagged your question with mysql. Then you write about "VALID" values. To me you would use the SQL results and if the results are not valid, work on your SQL queries.

Now if your database has invalid data, you would correct the database.

I suspect what you’re wanting to do is use AJAX to dynamically change a part of a form based on what is selected elsewhere in the form. For example, if you have two dropdowns, the selection you make in the first alters the menu items available in the second. Is that correct?

If so, I’m confused what that has to do with pagination?

commented: e.g. author XYZ has 10000 records. on author "XYZ" filter I am sending only first 10 records from backend. I required all the published dates of 10000 +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.