Show / Hide Table of Contents

    Class SortedSetSortField

    SortField for SortedSetDocValues.

    A SortedSetDocValues contains multiple values for a field, so sorting with this technique "selects" a value as the representative sort value for the document.

    By default, the minimum value in the set is selected as the sort value, but this can be customized. Selectors other than the default do have some limitations (see below) to ensure that all selections happen in constant-time for performance.

    Like sorting by string, this also supports sorting missing values as first or last, via MissingValue.

    Limitations:

    • Fields containing or more unique values are unsupported.
    • Selectors other than the default MIN require optional codec support. However several codecs provided by Lucene, including the current default codec, support this.

    Inheritance
    System.Object
    SortField
    SortedSetSortField
    Inherited Members
    SortField.FIELD_SCORE
    SortField.FIELD_DOC
    SortField.m_missingValue
    SortField.STRING_FIRST
    SortField.STRING_LAST
    SortField.Field
    SortField.Type
    SortField.Parser
    SortField.IsReverse
    SortField.ComparerSource
    SortField.BytesComparer
    SortField.Rewrite(IndexSearcher)
    SortField.NeedsScores
    Namespace: Lucene.Net.Sandbox.Queries
    Assembly: Lucene.Net.Sandbox.dll
    Syntax
    public class SortedSetSortField : SortField

    Constructors

    | Improve this Doc View Source

    SortedSetSortField(String, Boolean)

    Creates a sort, possibly in reverse, by the minimum value in the set for the document.

    Declaration
    public SortedSetSortField(string field, bool reverse)
    Parameters
    Type Name Description
    System.String field

    Name of field to sort by. Must not be null.

    System.Boolean reverse

    True if natural order should be reversed.

    | Improve this Doc View Source

    SortedSetSortField(String, Boolean, Selector)

    Creates a sort, possibly in reverse, specifying how the sort value from the document's set is selected.

    Declaration
    public SortedSetSortField(string field, bool reverse, Selector selector)
    Parameters
    Type Name Description
    System.String field

    Name of field to sort by. Must not be null.

    System.Boolean reverse

    True if natural order should be reversed.

    Selector selector

    custom selector for choosing the sort value from the set.

    NOTE: selectors other than MIN require optional codec support.

    Properties

    | Improve this Doc View Source

    MissingValue

    Set how missing values (the empty set) are sorted.

    Note that this must be STRING_FIRST or STRING_LAST.

    Declaration
    public override object MissingValue { get; set; }
    Property Value
    Type Description
    System.Object
    Overrides
    SortField.MissingValue
    | Improve this Doc View Source

    Selector

    Returns the selector in use for this sort

    Declaration
    public Selector Selector { get; }
    Property Value
    Type Description
    Selector

    Methods

    | 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

    GetComparer(Int32, Int32)

    Declaration
    public override FieldComparer GetComparer(int numHits, int sortPos)
    Parameters
    Type Name Description
    System.Int32 numHits
    System.Int32 sortPos
    Returns
    Type Description
    FieldComparer
    | Improve this Doc View Source

    GetHashCode()

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

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    SortField.ToString()
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)