Show / Hide Table of Contents

    Class ToParentBlockJoinCollector

    Collects parent document hits for a containing one more more BlockJoinQuery clauses, sorted by the specified parent . Note that this cannot perform arbitrary joins; rather, it requires that all joined documents are indexed as a doc block (using or . Ie, the join is computed at index time.

    The parent must only use fields from the parent documents; sorting by field in the child documents is not supported.

    You should only use this collector if one or more of the clauses in the query is a ToParentBlockJoinQuery. This collector will find those query clauses and record the matching child documents for the top scoring parent documents.

    Multiple joins (star join) and nested joins and a mix of the two are allowed, as long as in all cases the documents corresponding to a single row of each joined parent table were indexed as a doc block.

    For the simple star join you can retrieve the ITopGroups<TGroupValue> instance containing each ToParentBlockJoinQuery's matching child documents for the top parent groups, using GetTopGroups(ToParentBlockJoinQuery, Sort, Int32, Int32, Int32, Boolean). Ie, a single query, which will contain two or more ToParentBlockJoinQuery's as clauses representing the star join, can then retrieve two or more ITopGroups<TGroupValue> instances.

    For nested joins, the query will run correctly (ie, match the right parent and child documents), however, because TopGroups<TGroupValue> is currently unable to support nesting (each group is not able to hold another TopGroups<TGroupValue>), you are only able to retrieve the TopGroups<TGroupValue> of the first join. The TopGroups<TGroupValue> of the nested joins will not be correct.

    See http://lucene.apache.org/core/4_8_0/join/ for a code sample.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    ToParentBlockJoinCollector
    Namespace: Lucene.Net.Join
    Assembly: Lucene.Net.Join.dll
    Syntax
    public class ToParentBlockJoinCollector : ICollector

    Constructors

    | Improve this Doc View Source

    ToParentBlockJoinCollector(Sort, Int32, Boolean, Boolean)

    Creates a ToParentBlockJoinCollector. The provided sort must not be null. If you pass true trackScores, all ToParentBlockQuery instances must not use None.

    Declaration
    public ToParentBlockJoinCollector(Sort sort, int numParentHits, bool trackScores, bool trackMaxScore)
    Parameters
    Type Name Description
    Sort sort
    System.Int32 numParentHits
    System.Boolean trackScores
    System.Boolean trackMaxScore

    Properties

    | Improve this Doc View Source

    AcceptsDocsOutOfOrder

    Declaration
    public virtual bool AcceptsDocsOutOfOrder { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    MaxScore

    Returns the highest score across all collected parent hits, as long as trackMaxScores=true was passed ToParentBlockJoinCollector(Sort, Int32, Boolean, Boolean) on construction. Else, this returns .

    Declaration
    public virtual float MaxScore { get; }
    Property Value
    Type Description
    System.Single

    Methods

    | Improve this Doc View Source

    Collect(Int32)

    Declaration
    public virtual void Collect(int parentDoc)
    Parameters
    Type Name Description
    System.Int32 parentDoc
    | Improve this Doc View Source

    GetTopGroups(ToParentBlockJoinQuery, Sort, Int32, Int32, Int32, Boolean)

    Returns the ITopGroups<TGroupValue> for the specified BlockJoinQuery. The groupValue of each GroupDocs will be the parent docID for that group. The number of documents within each group is calculated as minimum of maxDocsPerGroup and number of matched child documents for that group. Returns null if no groups matched.

    Declaration
    public virtual ITopGroups<int> GetTopGroups(ToParentBlockJoinQuery query, Sort withinGroupSort, int offset, int maxDocsPerGroup, int withinGroupOffset, bool fillSortFields)
    Parameters
    Type Name Description
    ToParentBlockJoinQuery query

    Search query

    Sort withinGroupSort

    Sort criteria within groups

    System.Int32 offset

    Parent docs offset

    System.Int32 maxDocsPerGroup

    Upper bound of documents per group number

    System.Int32 withinGroupOffset

    Offset within each group of child docs

    System.Boolean fillSortFields

    Specifies whether to add sort fields or not

    Returns
    Type Description
    ITopGroups<System.Int32>

    ITopGroups<TGroupValue> for specified query

    | Improve this Doc View Source

    GetTopGroupsWithAllChildDocs(ToParentBlockJoinQuery, Sort, Int32, Int32, Boolean)

    Returns the TopGroups<TGroupValue> for the specified BlockJoinQuery. The groupValue of each GroupDocs will be the parent docID for that group. The number of documents within each group equals to the total number of matched child documents for that group. Returns null if no groups matched.

    Declaration
    public virtual ITopGroups<int> GetTopGroupsWithAllChildDocs(ToParentBlockJoinQuery query, Sort withinGroupSort, int offset, int withinGroupOffset, bool fillSortFields)
    Parameters
    Type Name Description
    ToParentBlockJoinQuery query

    Search query

    Sort withinGroupSort

    Sort criteria within groups

    System.Int32 offset

    Parent docs offset

    System.Int32 withinGroupOffset

    Offset within each group of child docs

    System.Boolean fillSortFields

    Specifies whether to add sort fields or not

    Returns
    Type Description
    ITopGroups<System.Int32>

    ITopGroups<TGroupValue> for specified query

    | Improve this Doc View Source

    SetNextReader(AtomicReaderContext)

    Declaration
    public virtual void SetNextReader(AtomicReaderContext context)
    Parameters
    Type Name Description
    AtomicReaderContext context
    | Improve this Doc View Source

    SetScorer(Scorer)

    Declaration
    public virtual void SetScorer(Scorer scorer)
    Parameters
    Type Name Description
    Scorer scorer
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)