public final class JoinUtil extends Object
TermsQuery
and TermsCollector
.Modifier and Type | Method and Description |
---|---|
static Query |
createJoinQuery(String fromField,
String toField,
Query fromQuery,
IndexSearcher fromSearcher)
Method for query time joining.
|
public static Query createJoinQuery(String fromField, String toField, Query fromQuery, IndexSearcher fromSearcher) throws IOException
IndexSearcher
to retrieve all documents that have the same terms in the
to field that match with documents matching the specified fromQuery and have the same terms in the from field.
Notice: Can't join documents with a fromField that holds more then one term.fromField
- The from field to join fromtoField
- The to field to join tofromQuery
- The query to match documents on the from sidefromSearcher
- The searcher that executed the specified fromQueryQuery
instance that can be used to join documents based on the
terms in the from and to fieldIOException
- If I/O related errors occur