We use Typesense in order to search quickly in our NestJS backends. The Typesense backend is also accompanied by a PostgreSQL database. One of our issues is with custom Typesense searches.
Let me give you an example. An application has jobs and applicants. When an applicant is searching through the jobs it uses the filters which we send to Typesense. But we might want the applicants to only show the jobs that it hasn't applied for. What we currently might do in such an occasion is we search in our PostgreSQL database for all the job applicants for that person. Then we give that list of UUID's together with the search filters that the person has given. But the problem is that this list of UUID's might become to long and Typesense cannot handle so many input variables into it's search. We do not want to post-search filter because we use pagination standard in our filters and if we filter post the search in Typesense then the pagination might be wrong. If for instance the person searches the first 10 results. Then we search and find ten but we need to filter out those jobs that need to be filtered. So then we only have for instance 8 jobs left on the first page of x.
How can we handle this problem? I was thinking of creating a secondary table in Typesense where all the job applicants are stored and doing something like a left outer join on that table if something along those lines exist.