Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SortedSetSortField

    SortField for Lucene.Net.Index.SortedSetDocValues.

    A Lucene.Net.Index.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 System.Int32.MaxValue 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
    Lucene.Net.Search.SortField
    SortedSetSortField
    Inherited Members
    Lucene.Net.Search.SortField.FIELD_SCORE
    Lucene.Net.Search.SortField.FIELD_DOC
    Lucene.Net.Search.SortField.m_missingValue
    Lucene.Net.Search.SortField.STRING_FIRST
    Lucene.Net.Search.SortField.STRING_LAST
    Lucene.Net.Search.SortField.Field
    Lucene.Net.Search.SortField.Type
    Lucene.Net.Search.SortField.Parser
    Lucene.Net.Search.SortField.IsReverse
    Lucene.Net.Search.SortField.ComparerSource
    Lucene.Net.Search.SortField.BytesComparer
    Lucene.Net.Search.SortField.Rewrite(Lucene.Net.Search.IndexSearcher)
    Lucene.Net.Search.SortField.NeedsScores
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    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 Lucene.Net.Search.SortField.STRING_FIRST or Lucene.Net.Search.SortField.STRING_LAST.

    Declaration
    public override object MissingValue { get; set; }
    Property Value
    Type Description
    System.Object
    Overrides
    Lucene.Net.Search.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
    Overrides
    SortField.Equals(Object)
    | 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
    Lucene.Net.Search.FieldComparer
    Overrides
    SortField.GetComparer(Int32, Int32)
    | Improve this Doc View Source

    GetHashCode()

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

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    Lucene.Net.Search.SortField.ToString()
    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 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.