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>- (::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>- value (::Array<::String>) — Optional. The data field names to search. Required when using the default text search mode.
- (::Array<::String>) — Optional. The data field names to search. Required when using the default text search mode.
#filter
def filter() -> ::Google::Protobuf::Struct-
(::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g.
{"genre": {"$eq": "sci-fi"}}, represented as agoogle.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:$andor$orwith a list of filters, or$notwith one filter. Field operators and their values:$eqand$netake a string, number or bool;$lt,$lte,$gtand$gtetake a number;$in,$ninand$alltake a list of strings;$existstakes a bool. Several keys in one object (implicit AND) and implicit equality ({"genre": "sci-fi"}) are rejected; use$andand$eqinstead.Logical operators can be nested at most 2 levels deep, e.g.
{"$and": [{"$or": [{"a": {"$eq": 1}}, {"b": {"$eq": 2}}]}]}. Deeper filters are rejected withINVALID_ARGUMENT.
#filter=
def filter=(value) -> ::Google::Protobuf::Struct-
value (::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g.
{"genre": {"$eq": "sci-fi"}}, represented as agoogle.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:$andor$orwith a list of filters, or$notwith one filter. Field operators and their values:$eqand$netake a string, number or bool;$lt,$lte,$gtand$gtetake a number;$in,$ninand$alltake a list of strings;$existstakes a bool. Several keys in one object (implicit AND) and implicit equality ({"genre": "sci-fi"}) are rejected; use$andand$eqinstead.Logical operators can be nested at most 2 levels deep, e.g.
{"$and": [{"$or": [{"a": {"$eq": 1}}, {"b": {"$eq": 2}}]}]}. Deeper filters are rejected withINVALID_ARGUMENT.
-
(::Google::Protobuf::Struct) — Optional. A JSON filter expression, e.g.
{"genre": {"$eq": "sci-fi"}}, represented as agoogle.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:$andor$orwith a list of filters, or$notwith one filter. Field operators and their values:$eqand$netake a string, number or bool;$lt,$lte,$gtand$gtetake a number;$in,$ninand$alltake a list of strings;$existstakes a bool. Several keys in one object (implicit AND) and implicit equality ({"genre": "sci-fi"}) are rejected; use$andand$eqinstead.Logical operators can be nested at most 2 levels deep, e.g.
{"$and": [{"$or": [{"a": {"$eq": 1}}, {"b": {"$eq": 2}}]}]}. Deeper filters are rejected withINVALID_ARGUMENT.
#output_fields
def output_fields() -> ::Google::Cloud::VectorSearch::V1::OutputFields- (::Google::Cloud::VectorSearch::V1::OutputFields) — Optional. The fields to return in the search results.
#output_fields=
def output_fields=(value) -> ::Google::Cloud::VectorSearch::V1::OutputFields- value (::Google::Cloud::VectorSearch::V1::OutputFields) — Optional. The fields to return in the search results.
- (::Google::Cloud::VectorSearch::V1::OutputFields) — Optional. The fields to return in the search results.
#search_text
def search_text() -> ::String- (::String) — Optional. The query text. Required when using the default text search mode.
#search_text=
def search_text=(value) -> ::String- value (::String) — Optional. The query text. Required when using the default text search mode.
- (::String) — Optional. The query text. Required when using the default text search mode.
#structured_query
def structured_query() -> ::Google::Cloud::VectorSearch::V1::StructuredQuery-
(::Google::Cloud::VectorSearch::V1::StructuredQuery) — Optional. Structured query definition. When set,
search_textanddata_field_namesmust be left empty; otherwise the request will be rejected with anINVALID_ARGUMENTerror. Conversely, whenstructured_queryis unset, bothsearch_textanddata_field_namesare required.
#structured_query=
def structured_query=(value) -> ::Google::Cloud::VectorSearch::V1::StructuredQuery-
value (::Google::Cloud::VectorSearch::V1::StructuredQuery) — Optional. Structured query definition. When set,
search_textanddata_field_namesmust be left empty; otherwise the request will be rejected with anINVALID_ARGUMENTerror. Conversely, whenstructured_queryis unset, bothsearch_textanddata_field_namesare required.
-
(::Google::Cloud::VectorSearch::V1::StructuredQuery) — Optional. Structured query definition. When set,
search_textanddata_field_namesmust be left empty; otherwise the request will be rejected with anINVALID_ARGUMENTerror. Conversely, whenstructured_queryis unset, bothsearch_textanddata_field_namesare required.
#top_k
def top_k() -> ::Integer- (::Integer) — Optional. The number of results to return.
#top_k=
def top_k=(value) -> ::Integer- value (::Integer) — Optional. The number of results to return.
- (::Integer) — Optional. The number of results to return.