Class: Turbopuffer::Models::Query
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Turbopuffer::Models::Query
- Defined in:
- lib/turbopuffer/models/query.rb
Instance Attribute Summary collapse
-
#aggregate_by ⇒ Hash{Symbol=>Object}?
Aggregations to compute over all documents in the namespace that match the filters.
-
#distance_metric ⇒ Symbol, ...
A function used to calculate vector similarity.
-
#exclude_attributes ⇒ Array<String>?
List of attribute names to exclude from the response.
-
#filters ⇒ Object?
Exact filters for attributes to refine search results for.
-
#group_by ⇒ Array<String>?
Groups documents by the specified attributes (the “group key”) before computing aggregates.
-
#include_attributes ⇒ Boolean, ...
Whether to include attributes in the response.
-
#rank_by ⇒ Object?
How to rank the documents in the namespace.
-
#top_k ⇒ Integer?
The number of results to return.
Instance Method Summary collapse
-
#initialize(aggregate_by: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, rank_by: nil, top_k: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see Query for more details.
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(aggregate_by: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, rank_by: nil, top_k: nil) ⇒ Object
Some parameter documentations has been truncated, see Turbopuffer::Models::Query for more details.
Query, filter, full-text search and vector search documents.
|
|
# File 'lib/turbopuffer/models/query.rb', line 58
|
Instance Attribute Details
#aggregate_by ⇒ Hash{Symbol=>Object}?
Aggregations to compute over all documents in the namespace that match the filters.
11 |
# File 'lib/turbopuffer/models/query.rb', line 11 optional :aggregate_by, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown] |
#distance_metric ⇒ Symbol, ...
A function used to calculate vector similarity.
17 |
# File 'lib/turbopuffer/models/query.rb', line 17 optional :distance_metric, enum: -> { Turbopuffer::DistanceMetric } |
#exclude_attributes ⇒ Array<String>?
List of attribute names to exclude from the response. All other attributes will be included in the response.
24 |
# File 'lib/turbopuffer/models/query.rb', line 24 optional :exclude_attributes, Turbopuffer::Internal::Type::ArrayOf[String] |
#filters ⇒ Object?
Exact filters for attributes to refine search results for. Think of it as a SQL WHERE clause.
31 |
# File 'lib/turbopuffer/models/query.rb', line 31 optional :filters, Turbopuffer::Internal::Type::Unknown |
#group_by ⇒ Array<String>?
Groups documents by the specified attributes (the “group key”) before computing aggregates. Aggregates are computed separately for each group.
38 |
# File 'lib/turbopuffer/models/query.rb', line 38 optional :group_by, Turbopuffer::Internal::Type::ArrayOf[String] |
#include_attributes ⇒ Boolean, ...
Whether to include attributes in the response.
44 |
# File 'lib/turbopuffer/models/query.rb', line 44 optional :include_attributes, union: -> { Turbopuffer::IncludeAttributes } |
#rank_by ⇒ Object?
How to rank the documents in the namespace.
50 |
# File 'lib/turbopuffer/models/query.rb', line 50 optional :rank_by, Turbopuffer::Internal::Type::Unknown |
#top_k ⇒ Integer?
The number of results to return.
56 |
# File 'lib/turbopuffer/models/query.rb', line 56 optional :top_k, Integer |