我试图在Hibernate Search中理解一般的查询.我在理解forEntity(…)方法时遇到了一些麻烦.这是文档说的:
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.
QueryBuilder mythQB = searchFactory.buildQueryBuilder().forEntity( Myth.class ).get();
从上面你可以看到你必须命名一个实体.当您想要创建自己的查询构建器以在“根”查询中创建布尔查询时,您应该怎么做?你应该怎么绑?
假设我想要一个应该匹配“Apples”或“Pie”的布尔查询.这是两个不同的实体,所以目前我有两个不同的查询构建器.但我需要第三个来创建一个布尔查询.它应该绑定到Object类吗?