Hello, We are working on migrating our application to hibernate 6 and we’ve been testing various scenarios. One such case is using native lucene query using LuceneExtension. But the native lucene query isn’t returning any results. Whereas the same predicate returns the correct results if used with hibernate 6 search predicate.
Below is the query that we are using
SearchResult<List<?>> result =
searchSession
.search(getDomainClass())
.extension(LuceneExtension.get())
.select(projections.toArray( SearchProjection[]::new ))
.where(f -> f.fromLuceneQuery(luceneQuery))
.fetchAll();
The query string is “+_hibernate_class:com.rbs.ebpm.mireporting.common.service.clientdomain.XxxRequest +status:claimed”
The same query returns the correct results if used as below
SearchResult<List<?>> result =
searchSession
.search(getDomainClass())
.select(projections.toArray( SearchProjection[]::new ))
.where(f -> f.match().field("status").matching("claimed"))
.fetchAll();
We are using the latest lucene version 9.11.1. Can you please help on this? whether we are using the query in correct format.