Below are simple testcase:
It shows the following logs:
I can assure it calls my implementation of CurrentTenantIdentifierResolver, to get the "public" tenant ID (because it runs on different thread, my CurrentTenantIdentifierResolver could not get the previous tenant ID, so it returns "public" as default). It should not call the CurrentTenantIdentifierResolver, since the session I'm passing to FullTextSession has already had an tenantIdentifier (see the logs).
Using InheritableThreadLocal as informed by darioc in https://forum.hibernate.org/viewtopic.php?f=9&t=1023896 does make the indexer running properly, BUT it creates another problem, since the tenantIdentifier can be switched on concurrent http request.
It happens both in 4x version and 5x version. Tested on: 4.5.3.Final and 5.0.1.Final