Class ToParentBlockJoinQuery
This query requires that you index
children and parent docs as a single block, using the
or
API. In each block, the
child documents must appear first, ending with the parent
document. At search time you provide a
identifying the parents, however this must provide
an per sub-reader.
Once the block index is built, use this query to wrap
any sub-query matching only child docs and join matches in that
child document space up to the parent document space.
You can then use this as a clause with
other queries in the parent document space.
See ToChildBlockJoinQuery if you need to join
in the reverse order.
The child documents must be orthogonal to the parent
documents: the wrapped child query must never
return a parent document.
If you'd like to retrieve ITopGroups<TGroupValue> for the
resulting query, use the ToParentBlockJoinCollector.
Note that this is not necessary, ie, if you simply want
to collect the parent documents and don't need to see
which child documents matched under that parent, then
you can use any collector.
NOTE: If the overall query contains parent-only
matches, for example you OR a parent-only query with a
joined child-only query, then the resulting collected documents
will be correct, however the ITopGroups<TGroupValue> you get
from ToParentBlockJoinCollector will not contain every
child for parents that had matched.
See http://lucene.apache.org/core/4_8_0/join/ for an
overview.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Inheritance
System.Object
ToParentBlockJoinQuery
Assembly: Lucene.Net.Join.dll
Syntax
public class ToParentBlockJoinQuery : Query
Constructors
|
Improve this Doc
View Source
ToParentBlockJoinQuery(Query, Filter, ScoreMode)
Declaration
public ToParentBlockJoinQuery(Query childQuery, Filter parentsFilter, ScoreMode scoreMode)
Parameters
Type |
Name |
Description |
Query |
childQuery |
matching child documents.
|
Filter |
parentsFilter |
(must produce
per-segment, like FixedBitSetCachingWrapperFilter)
identifying the parent documents.
|
ScoreMode |
scoreMode |
How to aggregate multiple child scores
into a single parent score.
|
Methods
|
Improve this Doc
View Source
CreateWeight(IndexSearcher)
Declaration
public override Weight CreateWeight(IndexSearcher searcher)
Parameters
Type |
Name |
Description |
IndexSearcher |
searcher |
|
Returns
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public override void ExtractTerms(ISet<Term> terms)
Parameters
Type |
Name |
Description |
ISet<Term> |
terms |
|
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Rewrite(IndexReader)
Declaration
public override Query Rewrite(IndexReader reader)
Parameters
Type |
Name |
Description |
IndexReader |
reader |
|
Returns
|
Improve this Doc
View Source
ToString(String)
Declaration
public override string ToString(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
Type |
Description |
System.String |
|