Class: Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1DocumentQuery
- Inherits:
-
Object
- Object
- Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1DocumentQuery
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/contentwarehouse_v1/classes.rb,
lib/google/apis/contentwarehouse_v1/representations.rb,
lib/google/apis/contentwarehouse_v1/representations.rb
Instance Attribute Summary collapse
-
#custom_property_filter ⇒ String
This filter specifies a structured syntax to match against the [ PropertyDefinition].is_filterable marked as
true. -
#custom_weights_metadata ⇒ Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1CustomWeightsMetadata
To support the custom weighting across document schemas.
-
#document_creator_filter ⇒ Array<String>
The exact creator(s) of the documents to search against.
-
#document_name_filter ⇒ Array<String>
Search the documents in the list.
-
#document_schema_names ⇒ Array<String>
This filter specifies the exact document schema Document.document_schema_name of the documents to search against.
-
#file_type_filter ⇒ Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1FileTypeFilter
Filter for the specific types of documents returned.
-
#folder_name_filter ⇒ String
Search all the documents under this specified folder.
-
#is_nl_query ⇒ Boolean
(also: #is_nl_query?)
Experimental, do not use.
-
#property_filter ⇒ Array<Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1PropertyFilter>
This filter specifies a structured syntax to match against the PropertyDefinition.is_filterable marked as
true. -
#query ⇒ String
The query string that matches against the full text of the document and the searchable properties.
-
#query_context ⇒ Array<String>
For custom synonyms.
-
#time_filters ⇒ Array<Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1TimeFilter>
Documents created/updated within a range specified by this filter are searched against.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudContentwarehouseV1DocumentQuery
constructor
A new instance of GoogleCloudContentwarehouseV1DocumentQuery.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudContentwarehouseV1DocumentQuery
Returns a new instance of GoogleCloudContentwarehouseV1DocumentQuery.
1377 1378 1379 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1377 def initialize(**args) update!(**args) end |
Instance Attribute Details
#custom_property_filter ⇒ String
This filter specifies a structured syntax to match against the [
PropertyDefinition].is_filterable marked as true. The syntax for this
expression is a subset of SQL syntax. Supported operators are: =, !=, <,
<=, >, and >= where the left of the operator is a property name and the
right of the operator is a number or a quoted string. You must escape
backslash (\) and quote (\") characters. Supported functions are LOWER([
property_name]) to perform a case insensitive match and EMPTY([property_name]
) to filter on the existence of a key. Boolean expressions (AND/OR/NOT) are
supported up to 3 levels of nesting (for example, "((A AND B AND C) OR NOT D)
AND E"), a maximum of 100 comparisons or functions are allowed in the
expression. The expression must be < 6000 bytes in length. Sample Query: (
LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND
driving_years > 10
Corresponds to the JSON property customPropertyFilter
1274 1275 1276 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1274 def custom_property_filter @custom_property_filter end |
#custom_weights_metadata ⇒ Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1CustomWeightsMetadata
To support the custom weighting across document schemas.
Corresponds to the JSON property customWeightsMetadata
1279 1280 1281 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1279 def @custom_weights_metadata end |
#document_creator_filter ⇒ Array<String>
The exact creator(s) of the documents to search against. If a value isn't
specified, documents within the search results are associated with any creator.
If multiple values are specified, documents within the search results may be
associated with any of the specified creators.
Corresponds to the JSON property documentCreatorFilter
1287 1288 1289 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1287 def document_creator_filter @document_creator_filter end |
#document_name_filter ⇒ Array<String>
Search the documents in the list. Format: projects/project_number/locations/
location/documents/document_id.
Corresponds to the JSON property documentNameFilter
1293 1294 1295 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1293 def document_name_filter @document_name_filter end |
#document_schema_names ⇒ Array<String>
This filter specifies the exact document schema Document.document_schema_name
of the documents to search against. If a value isn't specified, documents
within the search results are associated with any schema. If multiple values
are specified, documents within the search results may be associated with any
of the specified schemas. At most 20 document schema names are allowed.
Corresponds to the JSON property documentSchemaNames
1302 1303 1304 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1302 def document_schema_names @document_schema_names end |
#file_type_filter ⇒ Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1FileTypeFilter
Filter for the specific types of documents returned.
Corresponds to the JSON property fileTypeFilter
1307 1308 1309 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1307 def file_type_filter @file_type_filter end |
#folder_name_filter ⇒ String
Search all the documents under this specified folder. Format: projects/
project_number/locations/location/documents/document_id.
Corresponds to the JSON property folderNameFilter
1313 1314 1315 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1313 def folder_name_filter @folder_name_filter end |
#is_nl_query ⇒ Boolean Also known as: is_nl_query?
Experimental, do not use. If the query is a natural language question. False
by default. If true, then the question-answering feature will be used instead
of search, and result_count in SearchDocumentsRequest must be set. In
addition, all other input fields related to search (pagination, histograms,
etc.) will be ignored.
Corresponds to the JSON property isNlQuery
1322 1323 1324 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1322 def is_nl_query @is_nl_query end |
#property_filter ⇒ Array<Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1PropertyFilter>
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable marked as true. The relationship between
the PropertyFilters is OR.
Corresponds to the JSON property propertyFilter
1330 1331 1332 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1330 def property_filter @property_filter end |
#query ⇒ String
The query string that matches against the full text of the document and the
searchable properties. The query partially supports Google AIP style syntax. Specifically, the query supports literals,
logical operators, negation operators, comparison operators, and functions.
Literals: A bare literal value (examples: "42", "Hugo") is a value to be
matched against. It searches over the full text of the document and the
searchable properties. Logical operators: "AND", "and", "OR", and "or" are
binary logical operators (example: "engineer OR developer"). Negation
operators: "NOT" and "!" are negation operators (example: "NOT software").
Comparison operators: support the binary comparison operators =, !=, <, >, <=
and >= for string, numeric, enum, boolean. Also support like operator ~~ for
string. It provides semantic search functionality by parsing, stemming and
doing synonyms expansion against the input query. To specify a property in the
query, the left hand side expression in the comparison must be the property ID
including the parent. The right hand side must be literals. For example: "\"
projects/123/locations/us\".property_a < 1" matches results whose "property_a"
is less than 1 in project 123 and us location. The literals and comparison
expression can be connected in a single query (example: "software engineer \"
projects/123/locations/us\".salary > 100"). Functions: supported functions are
LOWER([property_name]) to perform a case insensitive match and EMPTY([
property_name]) to filter on the existence of a key. Support nested
expressions connected using parenthesis and logical operators. The default
logical operators is AND if there is no operators between expressions. The
query can be used with other filters e.g. time_filters and
folder_name_filter. They are connected with AND operator under the hood.
The maximum number of allowed characters is 255.
Corresponds to the JSON property query
1360 1361 1362 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1360 def query @query end |
#query_context ⇒ Array<String>
For custom synonyms. Customers provide the synonyms based on context. One
customer can provide multiple set of synonyms based on different context. The
search query will be expanded based on the custom synonyms of the query
context set. By default, no custom synonyms wll be applied if no query context
is provided. It is not supported for CMEK compliant deployment.
Corresponds to the JSON property queryContext
1369 1370 1371 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1369 def query_context @query_context end |
#time_filters ⇒ Array<Google::Apis::ContentwarehouseV1::GoogleCloudContentwarehouseV1TimeFilter>
Documents created/updated within a range specified by this filter are searched
against.
Corresponds to the JSON property timeFilters
1375 1376 1377 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1375 def time_filters @time_filters end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 |
# File 'lib/google/apis/contentwarehouse_v1/classes.rb', line 1382 def update!(**args) @custom_property_filter = args[:custom_property_filter] if args.key?(:custom_property_filter) @custom_weights_metadata = args[:custom_weights_metadata] if args.key?(:custom_weights_metadata) @document_creator_filter = args[:document_creator_filter] if args.key?(:document_creator_filter) @document_name_filter = args[:document_name_filter] if args.key?(:document_name_filter) @document_schema_names = args[:document_schema_names] if args.key?(:document_schema_names) @file_type_filter = args[:file_type_filter] if args.key?(:file_type_filter) @folder_name_filter = args[:folder_name_filter] if args.key?(:folder_name_filter) @is_nl_query = args[:is_nl_query] if args.key?(:is_nl_query) @property_filter = args[:property_filter] if args.key?(:property_filter) @query = args[:query] if args.key?(:query) @query_context = args[:query_context] if args.key?(:query_context) @time_filters = args[:time_filters] if args.key?(:time_filters) end |