class Qdrant::Api::DiscoverRequest

Overview

Use context and a target to find the most similar points, constrained by the context.

Included Modules

Defined in:

qdrant-api/models/discover_request.cr

Constructors

Instance Method Summary

Macros inherited from module Qdrant::Api::Validation

validates(name, klass, nilable, **rules) validates

Instance methods inherited from module Qdrant::Api::Serializable

eql?(other) eql?, to_body : Hash(String, JSON::Any) to_body, to_h : Hash(String, JSON::Any) to_h, to_s(io : IO) : Nil to_s

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new(limit : Int32, shard_key : ShardKeySelector | Nil = nil, target : RecommendExample | Nil = nil, context : Array(ContextExamplePair) | Nil = nil, filter : Filter | Nil = nil, params : SearchParams | Nil = nil, offset : Int32 | Nil = nil, with_payload : WithPayloadInterface | Nil = nil, with_vector : WithVector | Nil = nil, using : String | Nil = nil, lookup_from : LookupLocation | Nil = nil) #

Initializes the object @param [Hash] attributes Model attributes in the form of hash


[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]
def self.new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node) #

[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def context : Array(ContextExamplePair) | Nil #

Pairs of { positive, negative } examples to constrain the search. When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. For discovery search (when including a target), the context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise.


[View source]
def context=(context : Array(ContextExamplePair) | Nil) #

Pairs of { positive, negative } examples to constrain the search. When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. For discovery search (when including a target), the context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise.


[View source]
def filter : Filter | Nil #

Look only for points which satisfies this conditions


[View source]
def filter=(filter : Filter | Nil) #

Look only for points which satisfies this conditions


[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def limit : Int32 #

Required properties Max number of result to return


[View source]
def limit=(value : Int32) #

Required properties Max number of result to return


[View source]
def limit_validation_error(value) : String | Nil #

[View source]
def list_invalid_properties #

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons


[View source]
def lookup_from : LookupLocation | Nil #

The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection


[View source]
def lookup_from=(lookup_from : LookupLocation | Nil) #

The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection


[View source]
def offset : Int32 | Nil #

Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.


[View source]
def offset=(value : Int32 | Nil) #

Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.


[View source]
def offset_validation_error(value) : String | Nil #

[View source]
def params : SearchParams | Nil #

Additional search params


[View source]
def params=(params : SearchParams | Nil) #

Additional search params


[View source]
def shard_key : ShardKeySelector | Nil #

Optional properties Specify in which shards to look for the points, if not specified - look in all shards


[View source]
def shard_key=(shard_key : ShardKeySelector | Nil) #

Optional properties Specify in which shards to look for the points, if not specified - look in all shards


[View source]
def target : RecommendExample | Nil #

Look for vectors closest to this. When using the target (with or without context), the integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target.


[View source]
def target=(target : RecommendExample | Nil) #

Look for vectors closest to this. When using the target (with or without context), the integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target.


[View source]
def using : String | Nil #

Define which vector to use for recommendation, if not specified - try to use default vector


[View source]
def using=(using : String | Nil) #

Define which vector to use for recommendation, if not specified - try to use default vector


[View source]
def valid? #

Check to see if the all the properties in the model are valid @return true if the model is valid


[View source]
def with_payload : WithPayloadInterface | Nil #

Select which payload to return with the response. Default is false.


[View source]
def with_payload=(with_payload : WithPayloadInterface | Nil) #

Select which payload to return with the response. Default is false.


[View source]
def with_vector : WithVector | Nil #

Options for specifying which vectors to include into response. Default is false.


[View source]
def with_vector=(with_vector : WithVector | Nil) #

Options for specifying which vectors to include into response. Default is false.


[View source]