TLDR Deniz experienced outdated search data when using the laravel-typesense adapter. Jason suggested using the single-document endpoint for real-time updates.
I was just wondering if anyone else is having this issue particularly when using the laravel-typesense adapter (although this issue would technically be present with any backend that uses jobs/queues).
We have a dedicated `search` queue worker to process any search changes to Typesense however sometimes this can take a few seconds to process and is done asynchronously so that means the search-data being returned to the frontend can possibly be out-of-date, and the frontend would need to be reloaded after a few seconds or poll the backend.
The main reason this issue arises is because essentially the frontend allows “items” in our business to be “withdrawn”, and withdrawing an item is a slightly intense process so we have that queued, but if we were to do it synchronously sure it would return an updated dataset directly from the DB in real-time so no need to refresh or poll, but this would still mean that the typesense search queue could be processing still, so if you were to refresh the page immediately you would still see outdated search-data.
Any insights would be much appreciated.
For time-sensitive real-time updates, you could use the single-document endpoint and index the document directly from your web servers into Typesense, while simultaneously writing to your DB, instead of doing it async via your background queuing system:
Indexed 3051 threads
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI