Class: Google::Cloud::Firestore::V1::StructuredQuery::FindNearest

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/firestore/v1/query.rb

Overview

Nearest Neighbors search config.

Defined Under Namespace

Modules: DistanceMeasure

Instance Attribute Summary collapse

Instance Attribute Details

#distance_measure::Google::Cloud::Firestore::V1::StructuredQuery::FindNearest::DistanceMeasure

Returns Required. The Distance Measure to use, required.

Returns:



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'proto_docs/google/firestore/v1/query.rb', line 389

class FindNearest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # The distance measure to use when comparing vectors.
  module DistanceMeasure
    # Should not be set.
    DISTANCE_MEASURE_UNSPECIFIED = 0

    # Measures the EUCLIDEAN distance between the vectors. See
    # [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn
    # more
    EUCLIDEAN = 1

    # Compares vectors based on the angle between them, which allows you to
    # measure similarity that isn't based on the vectors magnitude.
    # We recommend using DOT_PRODUCT with unit normalized vectors instead of
    # COSINE distance, which is mathematically equivalent with better
    # performance. See [Cosine
    # Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn
    # more.
    COSINE = 2

    # Similar to cosine but is affected by the magnitude of the vectors. See
    # [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more.
    DOT_PRODUCT = 3
  end
end

#limit::Google::Protobuf::Int32Value

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

Returns:



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'proto_docs/google/firestore/v1/query.rb', line 389

class FindNearest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # The distance measure to use when comparing vectors.
  module DistanceMeasure
    # Should not be set.
    DISTANCE_MEASURE_UNSPECIFIED = 0

    # Measures the EUCLIDEAN distance between the vectors. See
    # [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn
    # more
    EUCLIDEAN = 1

    # Compares vectors based on the angle between them, which allows you to
    # measure similarity that isn't based on the vectors magnitude.
    # We recommend using DOT_PRODUCT with unit normalized vectors instead of
    # COSINE distance, which is mathematically equivalent with better
    # performance. See [Cosine
    # Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn
    # more.
    COSINE = 2

    # Similar to cosine but is affected by the magnitude of the vectors. See
    # [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more.
    DOT_PRODUCT = 3
  end
end

#query_vector::Google::Cloud::Firestore::V1::Value

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

Returns:



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'proto_docs/google/firestore/v1/query.rb', line 389

class FindNearest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # The distance measure to use when comparing vectors.
  module DistanceMeasure
    # Should not be set.
    DISTANCE_MEASURE_UNSPECIFIED = 0

    # Measures the EUCLIDEAN distance between the vectors. See
    # [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn
    # more
    EUCLIDEAN = 1

    # Compares vectors based on the angle between them, which allows you to
    # measure similarity that isn't based on the vectors magnitude.
    # We recommend using DOT_PRODUCT with unit normalized vectors instead of
    # COSINE distance, which is mathematically equivalent with better
    # performance. See [Cosine
    # Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn
    # more.
    COSINE = 2

    # Similar to cosine but is affected by the magnitude of the vectors. See
    # [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more.
    DOT_PRODUCT = 3
  end
end

#vector_field::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference

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

Returns:



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'proto_docs/google/firestore/v1/query.rb', line 389

class FindNearest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # The distance measure to use when comparing vectors.
  module DistanceMeasure
    # Should not be set.
    DISTANCE_MEASURE_UNSPECIFIED = 0

    # Measures the EUCLIDEAN distance between the vectors. See
    # [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn
    # more
    EUCLIDEAN = 1

    # Compares vectors based on the angle between them, which allows you to
    # measure similarity that isn't based on the vectors magnitude.
    # We recommend using DOT_PRODUCT with unit normalized vectors instead of
    # COSINE distance, which is mathematically equivalent with better
    # performance. See [Cosine
    # Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn
    # more.
    COSINE = 2

    # Similar to cosine but is affected by the magnitude of the vectors. See
    # [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more.
    DOT_PRODUCT = 3
  end
end