Hi,
Hibernate OGM does not implement the Criteria API at this point. Therefore you need to configure a specific database retrieval method for full text queries which internally does not depend on the Criteria API. The following does the trick:
Code:
FullTextQuery ftq = fullTextEntityManager.createFullTextQuery(luceneQuery, Docu.class);
ftq.initializeObjectsWith(ObjectLookupMethod.SKIP, DatabaseRetrievalMethod.FIND_BY_ID);
Alternatively you can configure this globally when bootstrapping Hibernate OGM by setting the following properties in your persistence.xml (or map used for bootstrapping the entity manager factory):
Code:
hibernate.search.query.object_lookup_method = skip
hibernate.search.query.database_retrieval_method = find_by_id
This step will eventually be automated in Hibernate OGM (see https://hibernate.atlassian.net/browse/OGM-171), but we didn't get to this yet.
Hth,
--Gunnar