Extracted from PR: https://github.com/hibernate/hibernate-search/commit/a51e16bca141c7be80f8e6ead072d1313e21b34b