HS6 Lucene Backend - Highlighter

I realize there is no support for highlighting in HS 6, but was hoping to be able to extract a

org.apache.lucene.search.Query

object out of a hibernate search query / predicate while using the Lucene extension as that is what is required by the existing Lucene highlighter classes. Is there a way to do this? Thanks.

There is no API for this at the moment, but if you’re okay with relying on SPI that can change in a new minor version (6.x) or disappear in a new major version (7.0), you can use LuceneMigrationUtils:

SearchPredicate predicate = ...;
Query query = LuceneMigrationUtils.toLuceneQuery(predicate);

If you need proper API, please open a ticket.

EDIT: Linking to a related answer: java - How can I get the highlights of my result set in Hibernate search 6? - Stack Overflow