Vector Search V1 API - Class Google::Cloud::VectorSearch::V1::TextSearch (v0.6.0)

Reference documentation and code samples for the Vector Search V1 API class Google::Cloud::VectorSearch::V1::TextSearch.

Defines a text search operation.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#data_field_names

def data_field_names() -> ::Array<::String>
Returns
  • (::Array<::String>) — Optional. The data field names to search. Required when using the default text search mode.

#data_field_names=

def data_field_names=(value) -> ::Array<::String>
Parameter
  • value (::Array<::String>) — Optional. The data field names to search. Required when using the default text search mode.
Returns
  • (::Array<::String>) — Optional. The data field names to search. Required when using the default text search mode.

#filter

def filter() -> ::Google::Protobuf::Struct
Returns
  • (::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.

    An empty filter ({}) matches all data objects. Otherwise, each JSON object in the filter must have exactly one key: either a field name mapped to one operator ({"price": {"$lt": 100}}), or a logical operator: $and or $or with a list of filters, or $not with one filter. Field operators and their values: $eq and $ne take a string, number or bool; $lt, $lte, $gt and $gte take a number; $in, $nin and $all take a list of strings; $exists takes a bool. Several keys in one object (implicit AND) and implicit equality ({"genre": "sci-fi"}) are rejected; use $and and $eq instead.

    Logical operators can be nested at most 2 levels deep, e.g. {"$and": [{"$or": [{"a": {"$eq": 1}}, {"b": {"$eq": 2}}]}]}. Deeper filters are rejected with INVALID_ARGUMENT.

#filter=

def filter=(value) -> ::Google::Protobuf::Struct
Parameter
  • value (::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.

    An empty filter ({}) matches all data objects. Otherwise, each JSON object in the filter must have exactly one key: either a field name mapped to one operator ({"price": {"$lt": 100}}), or a logical operator: $and or $or with a list of filters, or $not with one filter. Field operators and their values: $eq and $ne take a string, number or bool; $lt, $lte, $gt and $gte take a number; $in, $nin and $all take a list of strings; $exists takes a bool. Several keys in one object (implicit AND) and implicit equality ({"genre": "sci-fi"}) are rejected; use $and and $eq instead.

    Logical operators can be nested at most 2 levels deep, e.g. {"$and": [{"$or": [{"a": {"$eq": 1}}, {"b": {"$eq": 2}}]}]}. Deeper filters are rejected with INVALID_ARGUMENT.

Returns
  • (::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}}, represented as a google.protobuf.Struct.

    An empty filter ({}) matches all data objects. Otherwise, each JSON object in the filter must have exactly one key: either a field name mapped to one operator ({"price": {"$lt": 100}}), or a logical operator: $and or $or with a list of filters, or $not with one filter. Field operators and their values: $eq and $ne take a string, number or bool; $lt, $lte, $gt and $gte take a number; $in, $nin and $all take a list of strings; $exists takes a bool. Several keys in one object (implicit AND) and implicit equality ({"genre": "sci-fi"}) are rejected; use $and and $eq instead.

    Logical operators can be nested at most 2 levels deep, e.g. {"$and": [{"$or": [{"a": {"$eq": 1}}, {"b": {"$eq": 2}}]}]}. Deeper filters are rejected with INVALID_ARGUMENT.

#output_fields

def output_fields() -> ::Google::Cloud::VectorSearch::V1::OutputFields
Returns

#output_fields=

def output_fields=(value) -> ::Google::Cloud::VectorSearch::V1::OutputFields
Parameter
Returns

#search_text

def search_text() -> ::String
Returns
  • (::String) — Optional. The query text. Required when using the default text search mode.

#search_text=

def search_text=(value) -> ::String
Parameter
  • value (::String) — Optional. The query text. Required when using the default text search mode.
Returns
  • (::String) — Optional. The query text. Required when using the default text search mode.

#structured_query

def structured_query() -> ::Google::Cloud::VectorSearch::V1::StructuredQuery
Returns
  • (::Google::Cloud::VectorSearch::V1::StructuredQuery) — Optional. Structured query definition. When set, search_text and data_field_names must be left empty; otherwise the request will be rejected with an INVALID_ARGUMENT error. Conversely, when structured_query is unset, both search_text and data_field_names are required.

#structured_query=

def structured_query=(value) -> ::Google::Cloud::VectorSearch::V1::StructuredQuery
Parameter
  • value (::Google::Cloud::VectorSearch::V1::StructuredQuery) — Optional. Structured query definition. When set, search_text and data_field_names must be left empty; otherwise the request will be rejected with an INVALID_ARGUMENT error. Conversely, when structured_query is unset, both search_text and data_field_names are required.
Returns
  • (::Google::Cloud::VectorSearch::V1::StructuredQuery) — Optional. Structured query definition. When set, search_text and data_field_names must be left empty; otherwise the request will be rejected with an INVALID_ARGUMENT error. Conversely, when structured_query is unset, both search_text and data_field_names are required.

#top_k

def top_k() -> ::Integer
Returns
  • (::Integer) — Optional. The number of results to return.

#top_k=

def top_k=(value) -> ::Integer
Parameter
  • value (::Integer) — Optional. The number of results to return.
Returns
  • (::Integer) — Optional. The number of results to return.