| I suggest to add the methods
/**
* Create a fulltext query on top of a native Lucene query returning the matching objects
* of type <code>resultType</code> and their respective subclasses.
*
* @param resultType enforce a result type analogue to JPA queries
* @param luceneQuery The native Lucene query to be run against the Lucene index.
* @param typeFilters List of classes for type filtering. The query result will only return entities of
* the specified types and their respective subtype. If no class is specified no type filtering will take place.
*
* @return A <code>FullTextTypedQuery</code> wrapping around the native Lucene query.
*
* @throws IllegalArgumentException if resultType is <code>null</code> or not a class or superclass annotated with <code>@Indexed</code>.
*/
<X> FullTextTypedQuery<X> createFullTextTypedQuery(org.apache.lucene.search.Query luceneQuery,
Class<X> resultType,
Class<? extends X>... typeFilters);
/**
* Creates a fulltext query from the given query descriptor.
*
* @param descriptor The query descriptor
* @param resultType enforce a result type analogue to JPA queries
* @param typeFilters List of classes for type filtering. The query result will only return entities of
* the specified types and their respective subtype. If no class is specified no type filtering will take place.
*
* @return A <code>FullTextTypedQuery</code> using the given query descriptor.
*
* @throws IllegalArgumentException if resultType is <code>null</code> or not a class or superclass annotated with <code>@Indexed</code>.
*/
<X> FullTextTypedQuery<X> createFullTextTypedQuery(QueryDescriptor descriptor,
Class<X> resultType,
Class<? extends X>... typeFilters);
to `FullTextEntityManager` and creating a `FullTextTypedQuery` extending `TypedQuery` instead of `Query` analogue to `FullTextQuery`. From a superficial point of view it seems to be possible, but it'd be the first step into hibernate-search for me, so I'll leave it at the suggestion. Since `FullTextEntityManager.createFullTextQuery` has a `@throws IllegalArgumentException if entityType is <code>null</code> or not a class or superclass annotated with <code>@Indexed</code>.` Javadoc which has no correspondance to the method, I'm uncertain whether this is part of a previous type-safe implementation which I didn't find. |