Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class PointVectorStrategy

    Simple SpatialStrategy which represents Points in two numeric Lucene.Net.Documents.DoubleFields. The Strategy's best feature is decent distance sort.

    Characteristics:

    • Only indexes points; just one per field value.
    • Can query by a rectangle or circle.
    • Intersects and IsWithin is supported.
    • Uses the FieldCache for MakeDistanceValueSource(IPoint) and for searching with a Circle.

    Implementation:

    This is a simple Strategy. Search works with Lucene.Net.Search.NumericRangeQuerys on an x & y pair of fields. A Circle query does the same bbox query but adds a ValueSource filter on MakeDistanceValueSource(IPoint).

    One performance shortcoming with this strategy is that a scenario involving both a search using a Circle and sort will result in calculations for the spatial distance being done twice -- once for the filter and second for the sort.

    Note

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

    Inheritance
    System.Object
    SpatialStrategy
    PointVectorStrategy
    Inherited Members
    SpatialStrategy.m_ctx
    SpatialStrategy.SpatialContext
    SpatialStrategy.FieldName
    SpatialStrategy.MakeDistanceValueSource(IPoint)
    SpatialStrategy.MakeRecipDistanceValueSource(IShape)
    SpatialStrategy.ToString()
    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)
    Namespace: Lucene.Net.Spatial.Vector
    Assembly: Lucene.Net.Spatial.dll
    Syntax
    public class PointVectorStrategy : SpatialStrategy

    Constructors

    | Improve this Doc View Source

    PointVectorStrategy(SpatialContext, String)

    Declaration
    public PointVectorStrategy(SpatialContext ctx, string fieldNamePrefix)
    Parameters
    Type Name Description
    Spatial4n.Context.SpatialContext ctx
    System.String fieldNamePrefix

    Fields

    | Improve this Doc View Source

    SUFFIX_X

    Declaration
    public const string SUFFIX_X = "__x"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    SUFFIX_Y

    Declaration
    public const string SUFFIX_Y = "__y"
    Field Value
    Type Description
    System.String

    Properties

    | Improve this Doc View Source

    PrecisionStep

    Declaration
    public virtual int PrecisionStep { get; set; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    CreateIndexableFields(IPoint)

    See CreateIndexableFields(IShape)

    Declaration
    public virtual Field[] CreateIndexableFields(IPoint point)
    Parameters
    Type Name Description
    Spatial4n.Shapes.IPoint point
    Returns
    Type Description
    Lucene.Net.Documents.Field[]
    | Improve this Doc View Source

    CreateIndexableFields(IShape)

    Declaration
    public override Field[] CreateIndexableFields(IShape shape)
    Parameters
    Type Name Description
    Spatial4n.Shapes.IShape shape
    Returns
    Type Description
    Lucene.Net.Documents.Field[]
    Overrides
    SpatialStrategy.CreateIndexableFields(IShape)
    | Improve this Doc View Source

    MakeDistanceValueSource(IPoint, Double)

    Declaration
    public override ValueSource MakeDistanceValueSource(IPoint queryPoint, double multiplier)
    Parameters
    Type Name Description
    Spatial4n.Shapes.IPoint queryPoint
    System.Double multiplier
    Returns
    Type Description
    Lucene.Net.Queries.Function.ValueSource
    Overrides
    SpatialStrategy.MakeDistanceValueSource(IPoint, Double)
    | Improve this Doc View Source

    MakeFilter(SpatialArgs)

    Declaration
    public override Filter MakeFilter(SpatialArgs args)
    Parameters
    Type Name Description
    SpatialArgs args
    Returns
    Type Description
    Lucene.Net.Search.Filter
    Overrides
    SpatialStrategy.MakeFilter(SpatialArgs)
    | Improve this Doc View Source

    MakeQuery(SpatialArgs)

    Declaration
    public override ConstantScoreQuery MakeQuery(SpatialArgs args)
    Parameters
    Type Name Description
    SpatialArgs args
    Returns
    Type Description
    Lucene.Net.Search.ConstantScoreQuery
    Overrides
    SpatialStrategy.MakeQuery(SpatialArgs)
    | Improve this Doc View Source

    MakeQueryDistanceScore(SpatialArgs)

    Declaration
    public virtual Query MakeQueryDistanceScore(SpatialArgs args)
    Parameters
    Type Name Description
    SpatialArgs args
    Returns
    Type Description
    Lucene.Net.Search.Query
    • 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.