My team currently has a search UI page that is a list of user records which are the hits from searching our users index. User can also add new user records from this same page and we need to be able to show them the newly added record in the search results right after they add a new user (or update a user) record in our index.
To achieve this reactivity, we have tried following the suggested approach of waiting (.wait()) on the algolia partialUpdateObjects/saveObjects operation which we call on the server when a new record is created or updated. When the server operation finishes when then refresh our search query on the UI to see the newly updated search results, as described in the documentation Index Operations Are Asynchronous | In depth | Sending and Managing Data | Guide | Algolia Documentation
This shows the updated search results but unfortunately it takes way too long. The .wait() call on the write operation (saveObjects or partialUpdateObject) takes many seconds (6+ seconds at least) for us and this significantly above what is acceptable UX for our use case.
This leads to the following questions:
- Is it expected that the wait() call on algolia updates can take many seconds?
- What are the recommended approaches for handling this situation on such front-end UIs? (we are using react instantsearch)
Thanks in advance!