Does anyone know how to modify search results before they are rendered when the modification depends on data returned from an async request?
I have a requirement to filter some search results according to only show results from sites that the user is following.
This approach works but it does cause some problems around the results count and paging and I would much prefer to remove the unwanted result rows from the result set before they are rendered to the page.
I can do this by modifying the results in ctx.ListData.ResultTables.ResultRows but unfortunately by the time I have retrieved the data I need to do the filtering the page has loaded and the results have rendered.
Is there a way I can hold the rendering of the display template back while I wait for the async request to complete?
Or is there just a better way of doing this altogether?