The workspace cannot be set anymore because the methode WorkspaceSelector.getWorkspaces() has been deleted.
It is called into the Solr script functions (Solr.js, line 27):
const workspaces = workspaceSelector.getWorkspaces();
Maybe replace it by:
RepositoryDao.getWorkspaces()
or from the session (but I don't know if it works in async mode).
Please do not use RepositoryDao which is not part of the API or the kernel classes