- 0.51.0 (latest)
- 0.50.0
- 0.49.0
- 0.48.0
- 0.47.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.41.0
- 0.40.0
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.0
- 0.35.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
public static final class DocumentQuery.Builder extends GeneratedMessageV3.Builder<DocumentQuery.Builder> implements DocumentQueryOrBuilder
Protobuf type google.cloud.contentwarehouse.v1.DocumentQuery
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > DocumentQuery.BuilderImplements
DocumentQueryOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptor |
Methods
addAllDocumentCreatorFilter(Iterable<String> values)
public DocumentQuery.Builder addAllDocumentCreatorFilter(Iterable<String> values)
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.
repeated string document_creator_filter = 11;
Parameter | |
---|---|
Name | Description |
values |
Iterable<String> The documentCreatorFilter to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addAllDocumentNameFilter(Iterable<String> values)
public DocumentQuery.Builder addAllDocumentNameFilter(Iterable<String> values)
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Parameter | |
---|---|
Name | Description |
values |
Iterable<String> The documentNameFilter to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addAllDocumentSchemaNames(Iterable<String> values)
public DocumentQuery.Builder addAllDocumentSchemaNames(Iterable<String> values)
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.
repeated string document_schema_names = 6;
Parameter | |
---|---|
Name | Description |
values |
Iterable<String> The documentSchemaNames to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addAllPropertyFilter(Iterable<? extends PropertyFilter> values)
public DocumentQuery.Builder addAllPropertyFilter(Iterable<? extends PropertyFilter> values)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameter | |
---|---|
Name | Description |
values |
Iterable<? extends com.google.cloud.contentwarehouse.v1.PropertyFilter> |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addAllQueryContext(Iterable<String> values)
public DocumentQuery.Builder addAllQueryContext(Iterable<String> values)
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.
repeated string query_context = 10;
Parameter | |
---|---|
Name | Description |
values |
Iterable<String> The queryContext to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addAllTimeFilters(Iterable<? extends TimeFilter> values)
public DocumentQuery.Builder addAllTimeFilters(Iterable<? extends TimeFilter> values)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameter | |
---|---|
Name | Description |
values |
Iterable<? extends com.google.cloud.contentwarehouse.v1.TimeFilter> |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addDocumentCreatorFilter(String value)
public DocumentQuery.Builder addDocumentCreatorFilter(String value)
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.
repeated string document_creator_filter = 11;
Parameter | |
---|---|
Name | Description |
value |
String The documentCreatorFilter to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addDocumentCreatorFilterBytes(ByteString value)
public DocumentQuery.Builder addDocumentCreatorFilterBytes(ByteString value)
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.
repeated string document_creator_filter = 11;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes of the documentCreatorFilter to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addDocumentNameFilter(String value)
public DocumentQuery.Builder addDocumentNameFilter(String value)
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Parameter | |
---|---|
Name | Description |
value |
String The documentNameFilter to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addDocumentNameFilterBytes(ByteString value)
public DocumentQuery.Builder addDocumentNameFilterBytes(ByteString value)
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes of the documentNameFilter to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addDocumentSchemaNames(String value)
public DocumentQuery.Builder addDocumentSchemaNames(String value)
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.
repeated string document_schema_names = 6;
Parameter | |
---|---|
Name | Description |
value |
String The documentSchemaNames to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addDocumentSchemaNamesBytes(ByteString value)
public DocumentQuery.Builder addDocumentSchemaNamesBytes(ByteString value)
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.
repeated string document_schema_names = 6;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes of the documentSchemaNames to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addPropertyFilter(PropertyFilter value)
public DocumentQuery.Builder addPropertyFilter(PropertyFilter value)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameter | |
---|---|
Name | Description |
value |
PropertyFilter |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addPropertyFilter(PropertyFilter.Builder builderForValue)
public DocumentQuery.Builder addPropertyFilter(PropertyFilter.Builder builderForValue)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameter | |
---|---|
Name | Description |
builderForValue |
PropertyFilter.Builder |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addPropertyFilter(int index, PropertyFilter value)
public DocumentQuery.Builder addPropertyFilter(int index, PropertyFilter value)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameters | |
---|---|
Name | Description |
index |
int |
value |
PropertyFilter |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addPropertyFilter(int index, PropertyFilter.Builder builderForValue)
public DocumentQuery.Builder addPropertyFilter(int index, PropertyFilter.Builder builderForValue)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameters | |
---|---|
Name | Description |
index |
int |
builderForValue |
PropertyFilter.Builder |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addPropertyFilterBuilder()
public PropertyFilter.Builder addPropertyFilterBuilder()
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Returns | |
---|---|
Type | Description |
PropertyFilter.Builder |
addPropertyFilterBuilder(int index)
public PropertyFilter.Builder addPropertyFilterBuilder(int index)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
PropertyFilter.Builder |
addQueryContext(String value)
public DocumentQuery.Builder addQueryContext(String value)
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.
repeated string query_context = 10;
Parameter | |
---|---|
Name | Description |
value |
String The queryContext to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addQueryContextBytes(ByteString value)
public DocumentQuery.Builder addQueryContextBytes(ByteString value)
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.
repeated string query_context = 10;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes of the queryContext to add. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public DocumentQuery.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addTimeFilters(TimeFilter value)
public DocumentQuery.Builder addTimeFilters(TimeFilter value)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameter | |
---|---|
Name | Description |
value |
TimeFilter |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addTimeFilters(TimeFilter.Builder builderForValue)
public DocumentQuery.Builder addTimeFilters(TimeFilter.Builder builderForValue)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameter | |
---|---|
Name | Description |
builderForValue |
TimeFilter.Builder |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addTimeFilters(int index, TimeFilter value)
public DocumentQuery.Builder addTimeFilters(int index, TimeFilter value)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameters | |
---|---|
Name | Description |
index |
int |
value |
TimeFilter |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addTimeFilters(int index, TimeFilter.Builder builderForValue)
public DocumentQuery.Builder addTimeFilters(int index, TimeFilter.Builder builderForValue)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameters | |
---|---|
Name | Description |
index |
int |
builderForValue |
TimeFilter.Builder |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
addTimeFiltersBuilder()
public TimeFilter.Builder addTimeFiltersBuilder()
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Returns | |
---|---|
Type | Description |
TimeFilter.Builder |
addTimeFiltersBuilder(int index)
public TimeFilter.Builder addTimeFiltersBuilder(int index)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
TimeFilter.Builder |
build()
public DocumentQuery build()
Returns | |
---|---|
Type | Description |
DocumentQuery |
buildPartial()
public DocumentQuery buildPartial()
Returns | |
---|---|
Type | Description |
DocumentQuery |
clear()
public DocumentQuery.Builder clear()
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
clearCustomPropertyFilter() (deprecated)
public DocumentQuery.Builder clearCustomPropertyFilter()
Deprecated. google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=104
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
string custom_property_filter = 4 [deprecated = true];
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
clearCustomWeightsMetadata()
public DocumentQuery.Builder clearCustomWeightsMetadata()
To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
.google.cloud.contentwarehouse.v1.CustomWeightsMetadata custom_weights_metadata = 13;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
clearDocumentCreatorFilter()
public DocumentQuery.Builder clearDocumentCreatorFilter()
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.
repeated string document_creator_filter = 11;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
clearDocumentNameFilter()
public DocumentQuery.Builder clearDocumentNameFilter()
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
clearDocumentSchemaNames()
public DocumentQuery.Builder clearDocumentSchemaNames()
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.
repeated string document_schema_names = 6;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
public DocumentQuery.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field |
FieldDescriptor |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
clearFileTypeFilter()
public DocumentQuery.Builder clearFileTypeFilter()
This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned.
If no value is specified, ALL files will be returned.
.google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
clearFolderNameFilter()
public DocumentQuery.Builder clearFolderNameFilter()
Search all the documents under this specified folder. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
string folder_name_filter = 9;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
clearIsNlQuery()
public DocumentQuery.Builder clearIsNlQuery()
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.
bool is_nl_query = 12;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public DocumentQuery.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter | |
---|---|
Name | Description |
oneof |
OneofDescriptor |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
clearPropertyFilter()
public DocumentQuery.Builder clearPropertyFilter()
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
clearQuery()
public DocumentQuery.Builder clearQuery()
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.
string query = 1;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
clearQueryContext()
public DocumentQuery.Builder clearQueryContext()
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.
repeated string query_context = 10;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
clearTimeFilters()
public DocumentQuery.Builder clearTimeFilters()
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
clone()
public DocumentQuery.Builder clone()
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
getCustomPropertyFilter() (deprecated)
public String getCustomPropertyFilter()
Deprecated. google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=104
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
string custom_property_filter = 4 [deprecated = true];
Returns | |
---|---|
Type | Description |
String |
The customPropertyFilter. |
getCustomPropertyFilterBytes() (deprecated)
public ByteString getCustomPropertyFilterBytes()
Deprecated. google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=104
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
string custom_property_filter = 4 [deprecated = true];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for customPropertyFilter. |
getCustomWeightsMetadata()
public CustomWeightsMetadata getCustomWeightsMetadata()
To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
.google.cloud.contentwarehouse.v1.CustomWeightsMetadata custom_weights_metadata = 13;
Returns | |
---|---|
Type | Description |
CustomWeightsMetadata |
The customWeightsMetadata. |
getCustomWeightsMetadataBuilder()
public CustomWeightsMetadata.Builder getCustomWeightsMetadataBuilder()
To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
.google.cloud.contentwarehouse.v1.CustomWeightsMetadata custom_weights_metadata = 13;
Returns | |
---|---|
Type | Description |
CustomWeightsMetadata.Builder |
getCustomWeightsMetadataOrBuilder()
public CustomWeightsMetadataOrBuilder getCustomWeightsMetadataOrBuilder()
To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
.google.cloud.contentwarehouse.v1.CustomWeightsMetadata custom_weights_metadata = 13;
Returns | |
---|---|
Type | Description |
CustomWeightsMetadataOrBuilder |
getDefaultInstanceForType()
public DocumentQuery getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
DocumentQuery |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns | |
---|---|
Type | Description |
Descriptor |
getDocumentCreatorFilter(int index)
public String getDocumentCreatorFilter(int index)
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.
repeated string document_creator_filter = 11;
Parameter | |
---|---|
Name | Description |
index |
int The index of the element to return. |
Returns | |
---|---|
Type | Description |
String |
The documentCreatorFilter at the given index. |
getDocumentCreatorFilterBytes(int index)
public ByteString getDocumentCreatorFilterBytes(int index)
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.
repeated string document_creator_filter = 11;
Parameter | |
---|---|
Name | Description |
index |
int The index of the value to return. |
Returns | |
---|---|
Type | Description |
ByteString |
The bytes of the documentCreatorFilter at the given index. |
getDocumentCreatorFilterCount()
public int getDocumentCreatorFilterCount()
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.
repeated string document_creator_filter = 11;
Returns | |
---|---|
Type | Description |
int |
The count of documentCreatorFilter. |
getDocumentCreatorFilterList()
public ProtocolStringList getDocumentCreatorFilterList()
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.
repeated string document_creator_filter = 11;
Returns | |
---|---|
Type | Description |
ProtocolStringList |
A list containing the documentCreatorFilter. |
getDocumentNameFilter(int index)
public String getDocumentNameFilter(int index)
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Parameter | |
---|---|
Name | Description |
index |
int The index of the element to return. |
Returns | |
---|---|
Type | Description |
String |
The documentNameFilter at the given index. |
getDocumentNameFilterBytes(int index)
public ByteString getDocumentNameFilterBytes(int index)
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Parameter | |
---|---|
Name | Description |
index |
int The index of the value to return. |
Returns | |
---|---|
Type | Description |
ByteString |
The bytes of the documentNameFilter at the given index. |
getDocumentNameFilterCount()
public int getDocumentNameFilterCount()
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Returns | |
---|---|
Type | Description |
int |
The count of documentNameFilter. |
getDocumentNameFilterList()
public ProtocolStringList getDocumentNameFilterList()
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Returns | |
---|---|
Type | Description |
ProtocolStringList |
A list containing the documentNameFilter. |
getDocumentSchemaNames(int index)
public String getDocumentSchemaNames(int index)
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.
repeated string document_schema_names = 6;
Parameter | |
---|---|
Name | Description |
index |
int The index of the element to return. |
Returns | |
---|---|
Type | Description |
String |
The documentSchemaNames at the given index. |
getDocumentSchemaNamesBytes(int index)
public ByteString getDocumentSchemaNamesBytes(int index)
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.
repeated string document_schema_names = 6;
Parameter | |
---|---|
Name | Description |
index |
int The index of the value to return. |
Returns | |
---|---|
Type | Description |
ByteString |
The bytes of the documentSchemaNames at the given index. |
getDocumentSchemaNamesCount()
public int getDocumentSchemaNamesCount()
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.
repeated string document_schema_names = 6;
Returns | |
---|---|
Type | Description |
int |
The count of documentSchemaNames. |
getDocumentSchemaNamesList()
public ProtocolStringList getDocumentSchemaNamesList()
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.
repeated string document_schema_names = 6;
Returns | |
---|---|
Type | Description |
ProtocolStringList |
A list containing the documentSchemaNames. |
getFileTypeFilter()
public FileTypeFilter getFileTypeFilter()
This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned.
If no value is specified, ALL files will be returned.
.google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8;
Returns | |
---|---|
Type | Description |
FileTypeFilter |
The fileTypeFilter. |
getFileTypeFilterBuilder()
public FileTypeFilter.Builder getFileTypeFilterBuilder()
This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned.
If no value is specified, ALL files will be returned.
.google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8;
Returns | |
---|---|
Type | Description |
FileTypeFilter.Builder |
getFileTypeFilterOrBuilder()
public FileTypeFilterOrBuilder getFileTypeFilterOrBuilder()
This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned.
If no value is specified, ALL files will be returned.
.google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8;
Returns | |
---|---|
Type | Description |
FileTypeFilterOrBuilder |
getFolderNameFilter()
public String getFolderNameFilter()
Search all the documents under this specified folder. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
string folder_name_filter = 9;
Returns | |
---|---|
Type | Description |
String |
The folderNameFilter. |
getFolderNameFilterBytes()
public ByteString getFolderNameFilterBytes()
Search all the documents under this specified folder. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
string folder_name_filter = 9;
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for folderNameFilter. |
getIsNlQuery()
public boolean getIsNlQuery()
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.
bool is_nl_query = 12;
Returns | |
---|---|
Type | Description |
boolean |
The isNlQuery. |
getPropertyFilter(int index)
public PropertyFilter getPropertyFilter(int index)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
PropertyFilter |
getPropertyFilterBuilder(int index)
public PropertyFilter.Builder getPropertyFilterBuilder(int index)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
PropertyFilter.Builder |
getPropertyFilterBuilderList()
public List<PropertyFilter.Builder> getPropertyFilterBuilderList()
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Returns | |
---|---|
Type | Description |
List<Builder> |
getPropertyFilterCount()
public int getPropertyFilterCount()
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Returns | |
---|---|
Type | Description |
int |
getPropertyFilterList()
public List<PropertyFilter> getPropertyFilterList()
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Returns | |
---|---|
Type | Description |
List<PropertyFilter> |
getPropertyFilterOrBuilder(int index)
public PropertyFilterOrBuilder getPropertyFilterOrBuilder(int index)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
PropertyFilterOrBuilder |
getPropertyFilterOrBuilderList()
public List<? extends PropertyFilterOrBuilder> getPropertyFilterOrBuilderList()
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Returns | |
---|---|
Type | Description |
List<? extends com.google.cloud.contentwarehouse.v1.PropertyFilterOrBuilder> |
getQuery()
public String getQuery()
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.
string query = 1;
Returns | |
---|---|
Type | Description |
String |
The query. |
getQueryBytes()
public ByteString getQueryBytes()
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.
string query = 1;
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for query. |
getQueryContext(int index)
public String getQueryContext(int index)
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.
repeated string query_context = 10;
Parameter | |
---|---|
Name | Description |
index |
int The index of the element to return. |
Returns | |
---|---|
Type | Description |
String |
The queryContext at the given index. |
getQueryContextBytes(int index)
public ByteString getQueryContextBytes(int index)
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.
repeated string query_context = 10;
Parameter | |
---|---|
Name | Description |
index |
int The index of the value to return. |
Returns | |
---|---|
Type | Description |
ByteString |
The bytes of the queryContext at the given index. |
getQueryContextCount()
public int getQueryContextCount()
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.
repeated string query_context = 10;
Returns | |
---|---|
Type | Description |
int |
The count of queryContext. |
getQueryContextList()
public ProtocolStringList getQueryContextList()
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.
repeated string query_context = 10;
Returns | |
---|---|
Type | Description |
ProtocolStringList |
A list containing the queryContext. |
getTimeFilters(int index)
public TimeFilter getTimeFilters(int index)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
TimeFilter |
getTimeFiltersBuilder(int index)
public TimeFilter.Builder getTimeFiltersBuilder(int index)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
TimeFilter.Builder |
getTimeFiltersBuilderList()
public List<TimeFilter.Builder> getTimeFiltersBuilderList()
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Returns | |
---|---|
Type | Description |
List<Builder> |
getTimeFiltersCount()
public int getTimeFiltersCount()
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Returns | |
---|---|
Type | Description |
int |
getTimeFiltersList()
public List<TimeFilter> getTimeFiltersList()
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Returns | |
---|---|
Type | Description |
List<TimeFilter> |
getTimeFiltersOrBuilder(int index)
public TimeFilterOrBuilder getTimeFiltersOrBuilder(int index)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
TimeFilterOrBuilder |
getTimeFiltersOrBuilderList()
public List<? extends TimeFilterOrBuilder> getTimeFiltersOrBuilderList()
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Returns | |
---|---|
Type | Description |
List<? extends com.google.cloud.contentwarehouse.v1.TimeFilterOrBuilder> |
hasCustomWeightsMetadata()
public boolean hasCustomWeightsMetadata()
To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
.google.cloud.contentwarehouse.v1.CustomWeightsMetadata custom_weights_metadata = 13;
Returns | |
---|---|
Type | Description |
boolean |
Whether the customWeightsMetadata field is set. |
hasFileTypeFilter()
public boolean hasFileTypeFilter()
This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned.
If no value is specified, ALL files will be returned.
.google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8;
Returns | |
---|---|
Type | Description |
boolean |
Whether the fileTypeFilter field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns | |
---|---|
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
mergeCustomWeightsMetadata(CustomWeightsMetadata value)
public DocumentQuery.Builder mergeCustomWeightsMetadata(CustomWeightsMetadata value)
To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
.google.cloud.contentwarehouse.v1.CustomWeightsMetadata custom_weights_metadata = 13;
Parameter | |
---|---|
Name | Description |
value |
CustomWeightsMetadata |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
mergeFileTypeFilter(FileTypeFilter value)
public DocumentQuery.Builder mergeFileTypeFilter(FileTypeFilter value)
This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned.
If no value is specified, ALL files will be returned.
.google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8;
Parameter | |
---|---|
Name | Description |
value |
FileTypeFilter |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
mergeFrom(DocumentQuery other)
public DocumentQuery.Builder mergeFrom(DocumentQuery other)
Parameter | |
---|---|
Name | Description |
other |
DocumentQuery |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public DocumentQuery.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters | |
---|---|
Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public DocumentQuery.Builder mergeFrom(Message other)
Parameter | |
---|---|
Name | Description |
other |
Message |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final DocumentQuery.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
removePropertyFilter(int index)
public DocumentQuery.Builder removePropertyFilter(int index)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
removeTimeFilters(int index)
public DocumentQuery.Builder removeTimeFilters(int index)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameter | |
---|---|
Name | Description |
index |
int |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setCustomPropertyFilter(String value) (deprecated)
public DocumentQuery.Builder setCustomPropertyFilter(String value)
Deprecated. google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=104
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
string custom_property_filter = 4 [deprecated = true];
Parameter | |
---|---|
Name | Description |
value |
String The customPropertyFilter to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setCustomPropertyFilterBytes(ByteString value) (deprecated)
public DocumentQuery.Builder setCustomPropertyFilterBytes(ByteString value)
Deprecated. google.cloud.contentwarehouse.v1.DocumentQuery.custom_property_filter is deprecated. See google/cloud/contentwarehouse/v1/filters.proto;l=104
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
string custom_property_filter = 4 [deprecated = true];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for customPropertyFilter to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setCustomWeightsMetadata(CustomWeightsMetadata value)
public DocumentQuery.Builder setCustomWeightsMetadata(CustomWeightsMetadata value)
To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
.google.cloud.contentwarehouse.v1.CustomWeightsMetadata custom_weights_metadata = 13;
Parameter | |
---|---|
Name | Description |
value |
CustomWeightsMetadata |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setCustomWeightsMetadata(CustomWeightsMetadata.Builder builderForValue)
public DocumentQuery.Builder setCustomWeightsMetadata(CustomWeightsMetadata.Builder builderForValue)
To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
.google.cloud.contentwarehouse.v1.CustomWeightsMetadata custom_weights_metadata = 13;
Parameter | |
---|---|
Name | Description |
builderForValue |
CustomWeightsMetadata.Builder |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setDocumentCreatorFilter(int index, String value)
public DocumentQuery.Builder setDocumentCreatorFilter(int index, String value)
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.
repeated string document_creator_filter = 11;
Parameters | |
---|---|
Name | Description |
index |
int The index to set the value at. |
value |
String The documentCreatorFilter to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setDocumentNameFilter(int index, String value)
public DocumentQuery.Builder setDocumentNameFilter(int index, String value)
Search the documents in the list. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
repeated string document_name_filter = 14;
Parameters | |
---|---|
Name | Description |
index |
int The index to set the value at. |
value |
String The documentNameFilter to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setDocumentSchemaNames(int index, String value)
public DocumentQuery.Builder setDocumentSchemaNames(int index, String value)
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.
repeated string document_schema_names = 6;
Parameters | |
---|---|
Name | Description |
index |
int The index to set the value at. |
value |
String The documentSchemaNames to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
public DocumentQuery.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setFileTypeFilter(FileTypeFilter value)
public DocumentQuery.Builder setFileTypeFilter(FileTypeFilter value)
This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned.
If no value is specified, ALL files will be returned.
.google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8;
Parameter | |
---|---|
Name | Description |
value |
FileTypeFilter |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setFileTypeFilter(FileTypeFilter.Builder builderForValue)
public DocumentQuery.Builder setFileTypeFilter(FileTypeFilter.Builder builderForValue)
This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned.
If no value is specified, ALL files will be returned.
.google.cloud.contentwarehouse.v1.FileTypeFilter file_type_filter = 8;
Parameter | |
---|---|
Name | Description |
builderForValue |
FileTypeFilter.Builder |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setFolderNameFilter(String value)
public DocumentQuery.Builder setFolderNameFilter(String value)
Search all the documents under this specified folder. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
string folder_name_filter = 9;
Parameter | |
---|---|
Name | Description |
value |
String The folderNameFilter to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setFolderNameFilterBytes(ByteString value)
public DocumentQuery.Builder setFolderNameFilterBytes(ByteString value)
Search all the documents under this specified folder. Format: projects/{project_number}/locations/{location}/documents/{document_id}.
string folder_name_filter = 9;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for folderNameFilter to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setIsNlQuery(boolean value)
public DocumentQuery.Builder setIsNlQuery(boolean value)
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.
bool is_nl_query = 12;
Parameter | |
---|---|
Name | Description |
value |
boolean The isNlQuery to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setPropertyFilter(int index, PropertyFilter value)
public DocumentQuery.Builder setPropertyFilter(int index, PropertyFilter value)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameters | |
---|---|
Name | Description |
index |
int |
value |
PropertyFilter |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setPropertyFilter(int index, PropertyFilter.Builder builderForValue)
public DocumentQuery.Builder setPropertyFilter(int index, PropertyFilter.Builder builderForValue)
This filter specifies a structured syntax to match against the
PropertyDefinition.is_filterable
marked as true
. The relationship between the PropertyFilters is OR.
repeated .google.cloud.contentwarehouse.v1.PropertyFilter property_filter = 7;
Parameters | |
---|---|
Name | Description |
index |
int |
builderForValue |
PropertyFilter.Builder |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setQuery(String value)
public DocumentQuery.Builder setQuery(String value)
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.
string query = 1;
Parameter | |
---|---|
Name | Description |
value |
String The query to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setQueryBytes(ByteString value)
public DocumentQuery.Builder setQueryBytes(ByteString value)
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.
string query = 1;
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for query to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setQueryContext(int index, String value)
public DocumentQuery.Builder setQueryContext(int index, String value)
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.
repeated string query_context = 10;
Parameters | |
---|---|
Name | Description |
index |
int The index to set the value at. |
value |
String The queryContext to set. |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
This builder for chaining. |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public DocumentQuery.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
index |
int |
value |
Object |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setTimeFilters(int index, TimeFilter value)
public DocumentQuery.Builder setTimeFilters(int index, TimeFilter value)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameters | |
---|---|
Name | Description |
index |
int |
value |
TimeFilter |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setTimeFilters(int index, TimeFilter.Builder builderForValue)
public DocumentQuery.Builder setTimeFilters(int index, TimeFilter.Builder builderForValue)
Documents created/updated within a range specified by this filter are searched against.
repeated .google.cloud.contentwarehouse.v1.TimeFilter time_filters = 5;
Parameters | |
---|---|
Name | Description |
index |
int |
builderForValue |
TimeFilter.Builder |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final DocumentQuery.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
DocumentQuery.Builder |