I am trying to understand queries in general in Hibernate Search. I have some trouble understanding the forEntity(...)
method. This is what the documentation says:
Let's see how to use the API. You first need to create a query builder that is attached to a given indexed entity type. This QueryBuilder will know what analyzer to use and what field bridge to apply. You can create several QueryBuilders (one for each entity type involved in the root of your query). You get the QueryBuilder from the SearchFactory.
From section: 5.1.2. Building a Lucene query with the Hibernate Search query DSL
QueryBuilder mythQB = searchFactory.buildQueryBuilder().forEntity( Myth.class ).get();
From above you see that you have to name an entity. What are you supposed to to when you want to create an own querybuilder for creating a boolean query inside the "root" query? What should you bind that too?
Let say I want to have a boolean query that should match either "Apples" or "Pie". That is two different entity, so currently I have two different querybuilders for them. But I need a third one to create a boolean query. Should this be bound to Object
class?