Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class JoinUtil

    Utility for query time joining using Lucene.Net.Search.Join.TermsQuery and Lucene.Net.Search.Join.TermsCollector.

    Note

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

    Inheritance
    System.Object
    JoinUtil
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Search.Join
    Assembly: Lucene.Net.Join.dll
    Syntax
    public sealed class JoinUtil

    Methods

    | Improve this Doc View Source

    CreateJoinQuery(String, Boolean, String, Query, IndexSearcher, ScoreMode)

    Method for query time joining.

    Execute the returned query with a Lucene.Net.Search.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.

    In the case a single document relates to more than one document the multipleValuesPerDocument option should be set to true. When the multipleValuesPerDocument is set to true only the the score from the first encountered join value originating from the 'from' side is mapped into the 'to' side. Even in the case when a second join value related to a specific document yields a higher score. Obviously this doesn't apply in the case that None is used, since no scores are computed at all.

    Memory considerations: During joining all unique join values are kept in memory. On top of that when the scoreMode isn't set to None a float value per unique join value is kept in memory for computing scores. When scoreMode is set to Avg also an additional integer value is kept in memory per unique join value.

    Declaration
    public static Query CreateJoinQuery(string fromField, bool multipleValuesPerDocument, string toField, Query fromQuery, IndexSearcher fromSearcher, ScoreMode scoreMode)
    Parameters
    Type Name Description
    System.String fromField

    The from field to join from

    System.Boolean multipleValuesPerDocument

    Whether the from field has multiple terms per document

    System.String toField

    The to field to join to

    Lucene.Net.Search.Query fromQuery

    The query to match documents on the from side

    Lucene.Net.Search.IndexSearcher fromSearcher

    The searcher that executed the specified fromQuery

    ScoreMode scoreMode

    Instructs how scores from the fromQuery are mapped to the returned query

    Returns
    Type Description
    Lucene.Net.Search.Query

    A Lucene.Net.Search.Query instance that can be used to join documents based on the terms in the from and to field

    Exceptions
    Type Condition
    System.IO.IOException

    If I/O related errors occur

    • 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.