|
So, QueryTimeJoin basically allows you to filter a resultset based on a selection from a specific index that may be different than the one you're querying.
The way it works is that you basically select a single field based on a query and use that to filter on a field in the query you are executing. So in SQL terms, it can be seen as a WHERE myId IN (select myId from ) type query
One thing to realize is that due to current limitations in this Lucene module, the fields that are used to execute the filter have to be text fields.
In terms of API, perhaps this could be defined as such
QueryBuilder main = fts.getSearchFactory().buildQueryBuilder().forEntity(Main.class).get();
QueryBuilder sub = fts.getSearchFactory().buildQueryBuilder().forEntity(Sub.class).get();
main.subQuery().onField("subId").matching(
sub.keyword().onField("id").matching(sub.getId().toString()).createQuery()
).createQuery()
|