Hello, We are migrating from hibernate 5 to 6 with lucene backend. Made few changes and able to get results without projections. When it comes to projections, the existing application populates the fields dynamically and sets it to the full text query. But in hibernate 6, the projection fields seem to be predefined as per the documents i.e., defined as composite fields or using projection constructors taking in predefined parameters. The below query returns the results correctly when I provide these fields manually. But in our case, the fields come up dynamically through a string array. Is there a way to populate the projection fields each time from the String array?
session.search(XxxRequest.class)
.select(f -> f.composite()
.from( f.field("pk", String.class),
f.field("approvedTime", LocalDateTime.class),
f.field("claimedTime", LocalDateTime.class),
f.field("creationTime", LocalDateTime.class),
f.field("franchise", String.class)).asList())
.where(f -> f.match().field("status").matching("claimed"))
.toQuery();