Backend search with Runtime Filtering

I’m evaluating Algolia for a use-case that would involve an InstantSearch frontend, with a custom backend search similar to the one illustrated here (Implement back-end search with InstantSearch.js | Algolia) but instead of modifying the records returned from Algolia’s servers, I’d like to remove selected records.

We’d be removing search hits based on the results of runtime evaluation of a machine-learning model that takes the authenticated user and the search result as its inputs. I don’t think it’s going to be feasible to precompute this model and push the results into Algolia’s indexes for all possible combinations of users and documents, hence my desire to do this via backend search.

From what I can see, the main problem is going to be pagination - because we’d be removing search results, pages as seen by the UI won’t align with pages from the index, and so in order to serve e.g. the second page of results to the UI, I have no idea what offset I’d need to start with when reading from the index unless there was a way to remember where I left off on the first page, and preserve that context between successive API calls from the UI. Does such a capability exist, or are there other ways of approaching this problem that folks could point me to?

1 Like

Are there any updates on this? Do you find any kind of solution for this @alexhall99 ?

We’re needing this too. any info on a possible solution would be much appreciated!