Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ToParentBlockJoinQuery

    This query requires that you index children and parent docs as a single block, using the AddDocuments(IEnumerable<IEnumerable<IIndexableField>>, Analyzer) or UpdateDocuments(Term, IEnumerable<IEnumerable<IIndexableField>>, Analyzer) API. In each block, the child documents must appear first, ending with the parent document. At search time you provide a Lucene.Net.Search.Filter identifying the parents, however this Lucene.Net.Search.Filter must provide an Lucene.Net.Util.FixedBitSet 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 Lucene.Net.Search.Query 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 Lucene.Net.Search.Grouping.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 Lucene.Net.Search.Grouping.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.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    System.Object
    Lucene.Net.Search.Query
    ToParentBlockJoinQuery
    Inherited Members
    Lucene.Net.Search.Query.Boost
    Lucene.Net.Search.Query.ToString()
    Lucene.Net.Search.Query.Clone()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Lucene.Net.Search.Join
    Assembly: Lucene.Net.Join.dll
    Syntax
    public class ToParentBlockJoinQuery : Query

    Constructors

    | Improve this Doc View Source

    ToParentBlockJoinQuery(Query, Filter, ScoreMode)

    Create a ToParentBlockJoinQuery.

    Declaration
    public ToParentBlockJoinQuery(Query childQuery, Filter parentsFilter, ScoreMode scoreMode)
    Parameters
    Type Name Description
    Lucene.Net.Search.Query childQuery

    Lucene.Net.Search.Query matching child documents.

    Lucene.Net.Search.Filter parentsFilter

    Lucene.Net.Search.Filter (must produce Lucene.Net.Util.FixedBitSet 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
    Lucene.Net.Search.IndexSearcher searcher
    Returns
    Type Description
    Lucene.Net.Search.Weight
    Overrides
    Lucene.Net.Search.Query.CreateWeight(Lucene.Net.Search.IndexSearcher)
    | 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
    Overrides
    Query.Equals(Object)
    | Improve this Doc View Source

    ExtractTerms(ISet<Term>)

    Declaration
    public override void ExtractTerms(ISet<Term> terms)
    Parameters
    Type Name Description
    System.Collections.Generic.ISet<Lucene.Net.Index.Term> terms
    Overrides
    Query.ExtractTerms(ISet<Term>)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    Lucene.Net.Search.Query.GetHashCode()
    | Improve this Doc View Source

    Rewrite(IndexReader)

    Declaration
    public override Query Rewrite(IndexReader reader)
    Parameters
    Type Name Description
    Lucene.Net.Index.IndexReader reader
    Returns
    Type Description
    Lucene.Net.Search.Query
    Overrides
    Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader)
    | 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
    Overrides
    Query.ToString(String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2022 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.