HSEARCH-1191 / again

replaces PR #530 and #547

https://hibernate.atlassian.net/browse/HSEARCH-1191