1)we ask for the target type when creating a QueryBuilder, then we ask again for the same information again at FullTextQuery creation - they must match.
2)it seems that when people get the match wrong, they receive cryptic error messages (see https://forum.hibernate.org/viewtopic.php?f=9&t=1009700 )
It would be nice if we could infer the target type from the builder, we'd likely have to introduce a new class hiding away org.apache.search.Query in something which knows a bit more about types. Or maybe introduce a new method in FullTextSession to create a Hibernate.Query directly from the builder, projecting on the known types.
train of thoughts.. maybe this could lead to a typesafe API to define fulltext projections reusing JPA2 metamodel in case it's available.