com.atlassian.greenhopper.service.lucene
Class LeftJoinQuery
java.lang.Object
org.apache.lucene.search.Query
com.atlassian.greenhopper.service.lucene.AbstractBitsetQuery
com.atlassian.greenhopper.service.lucene.LeftJoinQuery
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class LeftJoinQuery
- extends AbstractBitsetQuery
TODO FIXUP this doco
A query that performs a join between two indexes (left and right).
This query can be used on the left index, and it selects documents in the left
that match documents on the right. Documents on the left/right are "matched" using
a fields with common values.
Specifically, this query will match documents in leftIndex, where
leftdoc.leftField == rightdoc.rightField, and rightdoc is in rightDocIds;
This implementation doesn't do anything smart wrt to scoring at the moment.
Performance will be expected to be O(l+r); l is the number of Terms that match on the left,
r is the number of terms that match on the right.
In the case where there is a 1-1 between left and right, best-case becomes O(1)
- Author:
- Matt Quail
- See Also:
- Serialized Form
Constructor Summary |
LeftJoinQuery(java.lang.String leftField,
org.apache.lucene.index.IndexReader rightReader,
java.lang.String rightField,
java.util.BitSet rightDocIds)
|
LeftJoinQuery(java.lang.String leftField,
RightJoinEnum rightEnum)
|
Methods inherited from class org.apache.lucene.search.Query |
clone, combine, createWeight, equals, extractTerms, getBoost, hashCode, mergeBooleanQueries, setBoost, toString, weight |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
LeftJoinQuery
public LeftJoinQuery(java.lang.String leftField,
org.apache.lucene.index.IndexReader rightReader,
java.lang.String rightField,
java.util.BitSet rightDocIds)
- Parameters:
leftField
- the match field on the leftrightReader
- the Reader for the left indexrightField
- the match field on the rightrightDocIds
- the documents on the right to consider
LeftJoinQuery
public LeftJoinQuery(java.lang.String leftField,
RightJoinEnum rightEnum)
makeRightEnum
public static RightJoinEnum makeRightEnum(java.util.BitSet rightDocIds,
org.apache.lucene.index.IndexReader rightReader,
java.lang.String rightField)
makeBitsetRightJoin
public static BitSetRightJoinEnum makeBitsetRightJoin(java.util.BitSet rightDocIds,
org.apache.lucene.index.IndexReader rightReader,
java.lang.String rightField)
makeDocumentRightEnum
public static DocumentRightJoinEnum makeDocumentRightEnum(java.util.BitSet rightDocIds,
org.apache.lucene.index.IndexReader rightReader,
java.lang.String rightField)
computeBitset
protected java.util.BitSet computeBitset(org.apache.lucene.index.IndexReader reader)
throws java.io.IOException
- Specified by:
computeBitset
in class AbstractBitsetQuery
- Throws:
java.io.IOException
getFilterExplanation
protected java.lang.String getFilterExplanation()
- Specified by:
getFilterExplanation
in class AbstractBitsetQuery
toString
public java.lang.String toString(java.lang.String field)
- Specified by:
toString
in class org.apache.lucene.search.Query
Copyright © 2007-2013 Atlassian. All Rights Reserved.