Agreed, the performance of executing a Hibernate ORM filter on top of our full-text queries would probably be awful. We should issue warnings/errors when a users attempt to use Hibernate ORM filters in a full text query. There may be a way out, though... what if we provided a way for users to map Hibernate ORM filters to full-text filters? Something like that:
@Entity(name = "Account")
@FilterDef(name="activeAccount", parameters=@ParamDef( name="active", type="boolean" ) )
@Filter(name="activeAccount", condition="active = :active")
@FullTextFilterDef(name = "activeAccount", impl = ActiveAccountFilter.class)
@org.hibernate.search.orm.FullTextFilterMapping(ormRef = "activeAccount", searchRef = "activeAccount")
public static class Account {
We could also assume that full-text filters with the same name as a Hibernate ORM filter are full-text equivalent of the ORM filter, but that seems a bit dangerous to me. In any case, I'm not sure we can implement it before 6. |