| The type predicate would allow to filter by mapped type. It would only accept an indexed type, and would be translated into a predicate filtering by index name. API-wise we would have to allow any Object to be passed to represent the type, unless we define the type() predicate in a mapper-specific extension, in which case we could require a Class<?> for the POJO mapper. The type predicate can be useful in cases like this: https://stackoverflow.com/questions/53414076/hibernate-search-query-for-multiple-entities/53414429#53414429 . In short, when you target multiple indexes in the same query, sometimes you need a predicate to apply to only one index; the easiest way to do that would be to add a boolean query with two "should" clause: the first is the predicate you need, and the second is a type predicate matching any type that doesn't have to match the first predicate. |