5.3.0 (latest) 5.2.0 5.1.0 5.0.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.5.0 3.4.0 3.3.0 3.2.0

    public sealed class FindNearest : IMessage<FindNearest>, IEquatable<FindNearest>, IDeepCloneable<FindNearest>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud Datastore v1 API class FindNearest.

Nearest Neighbors search config. The ordering provided by FindNearest
supersedes the order_by stage. If multiple documents have the same vector
distance, the returned document order is not guaranteed to be stable between
queries.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> FindNearest

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[FindNearest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.FindNearest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[FindNearest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.FindNearest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[FindNearest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.FindNearest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Datastore.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1)

## Assembly

Google.Cloud.Datastore.V1.dll

## Constructors

### FindNearest()

    public FindNearest()

### FindNearest(FindNearest)

    public FindNearest(FindNearest other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.FindNearest` |

## Properties

### DistanceMeasure

    public FindNearest.Types.DistanceMeasure DistanceMeasure { get; set; }

Required. The Distance Measure to use, required.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.FindNearesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.FindNearest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.FindNearest.Types.DistanceMeasure` |   |

### DistanceResultProperty

    public string DistanceResultProperty { get; set; }

Optional. Optional name of the field to output the result of the vector
distance calculation. Must conform to \[entity
property\]\[google.datastore.v1.Entity.properties\] limitations.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DistanceThreshold

    public double? DistanceThreshold { get; set; }

Optional. Option to specify a threshold for which no less similar documents
will be returned. The behavior of the specified `distance_measure` will
affect the meaning of the distance threshold. Since DOT_PRODUCT distances
increase when the vectors are more similar, the comparison is inverted.

- For EUCLIDEAN, COSINE: WHERE distance \<= distance_threshold
- For DOT_PRODUCT: WHERE distance \>= distance_threshold

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.double` |   |

### Limit

    public int? Limit { get; set; }

Required. The number of nearest neighbors to return. Must be a positive
integer of no more than 100.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### QueryVector

    public Value QueryVector { get; set; }

Required. The query vector that we are searching on. Must be a vector of no
more than 2048 dimensions.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Value` |   |

### VectorProperty

    public PropertyReference VectorProperty { get; set; }

Required. An indexed vector property to search upon. Only documents which
contain vectors whose dimensionality match the query_vector can be
returned.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.PropertyReference` |   |