- Resource: SearchConfig
- FacetProperty
- FixedRangeBucketSpec
- FacetValue
- CustomRangeBucketSpec
- DateTimeBucketSpec
- Granularity
- FacetBucketType
- SearchCriteriaProperty
- Methods
Resource: SearchConfig
SearchConfig stores different properties that will affect search behaviors and search results.
| JSON representation | 
|---|
| { "name" : string , "facetProperty" : { object ( | 
| Fields | |
|---|---|
| name |   Resource name of the search configuration. For CustomSearchCriteria, searchConfig would be the search operator name. For Facets, searchConfig would be the facet dimension name. Form:  | 
| facetProperty |   Establishes a FacetDimension and associated specifications. | 
| searchCriteriaProperty |   Creates a mapping between a custom SearchCriteria and one or more UGA keys. | 
FacetProperty
Central configuration for a facet.
| JSON representation | 
|---|
| { "mappedFields" : [ string ] , "displayName" : string , "resultSize" : string , "bucketType" : enum ( | 
mappedFields[] 
 string 
Name of the facets, which are the dimensions users want to use to refine search results. mappedFields 
will match UserSpecifiedDataSchema keys.
For example, user can add a bunch of UGAs with the same key, such as player:adam, player:bob, player:charles. When multiple mappedFields are specified, will merge their value together as final facet value. E.g. home_team: a, home_team:b, away_team:a, away_team:c, when facet_field = [home_team, away_team], facet_value will be [a, b, c].
UNLESS this is a 1:1 facet dimension (mappedFields.size() == 1) AND the mapped_field equals the parent SearchConfig.name, the parent must also contain a SearchCriteriaProperty that maps to the same fields. mappedFields must not be empty.
displayName 
 string 
Display name of the facet. To be used by UI for facet rendering.
resultSize 
 string ( int64 
format) 
Maximum number of unique bucket to return for one facet. Bucket number can be large for high-cardinality facet such as "player". We only return top-n most related ones to user. If it's <= 0, the server will decide the appropriate resultSize.
bucketType 
 enum (  
 FacetBucketType 
 
)
Facet bucket type e.g. value, range.
Union field range_facet_config 
.
 range_facet_config 
can be only one of the following:
fixedRangeBucketSpec 
 object (  
 FixedRangeBucketSpec 
 
)
Fixed range facet bucket config.
customRangeBucketSpec 
 object (  
 CustomRangeBucketSpec 
 
)
Custom range facet bucket config.
datetimeBucketSpec 
 object (  
 DateTimeBucketSpec 
 
)
Datetime range facet bucket config.
FixedRangeBucketSpec
If bucket type is FIXED_RANGE, specify how values are bucketized. Use FixedRangeBucketSpec when you want to create multiple buckets with equal granularities. Using integer bucket value as an example, when bucketStart = 0, bucketGranularity = 10, bucketCount = 5, this facet will be aggregated via the following buckets: [-inf, 0), [0, 10), [10, 20), [20, 30), [30, inf). Notably, bucketCount <= 1 is an invalid spec.
| JSON representation | 
|---|
| { "bucketStart" : { object ( | 
| Fields | |
|---|---|
| bucketStart |   Lower bound of the bucket. NOTE: Only integer type is currently supported for this field. | 
| bucketGranularity |   Bucket granularity. NOTE: Only integer type is currently supported for this field. | 
| bucketCount |   Total number of buckets. | 
FacetValue
Definition of a single value with generic type.
| JSON representation | 
|---|
| { // Union field | 
CustomRangeBucketSpec
If bucket type is CUSTOM_RANGE, specify how values are bucketized. Use integer bucket value as an example, when the endpoints are 0, 10, 100, and 1000, we will generate the following facets: [-inf, 0), [0, 10), [10, 100), [100, 1000), [1000, inf). Notably: - endpoints must be listed in ascending order. Otherwise, the SearchConfig API will reject the facet config. - < 1 endpoints is an invalid spec.
| JSON representation | 
|---|
|  { 
 "endpoints" 
 : 
 [ 
 { 
 object (  | 
| Fields | |
|---|---|
| endpoints[] |   Currently, only integer type is supported for this field. | 
DateTimeBucketSpec
If bucket type is DATE, specify how date values are bucketized.
| JSON representation | 
|---|
|  { 
 "granularity" 
 : 
 enum (  | 
| Fields | |
|---|---|
| granularity |   Granularity of date type facet. | 
Granularity
Granularity enum for the datetime bucket.
| Enums | |
|---|---|
| GRANULARITY_UNSPECIFIED | Unspecified granularity. | 
| YEAR | Granularity is year. | 
| MONTH | Granularity is month. | 
| DAY | Granularity is day. | 
FacetBucketType
Different types for a facet bucket.
| Enums | |
|---|---|
| FACET_BUCKET_TYPE_UNSPECIFIED | Unspecified type. | 
| FACET_BUCKET_TYPE_VALUE | Value type. | 
| FACET_BUCKET_TYPE_DATETIME | Datetime type. | 
| FACET_BUCKET_TYPE_FIXED_RANGE | Fixed Range type. | 
| FACET_BUCKET_TYPE_CUSTOM_RANGE | Custom Range type. | 
SearchCriteriaProperty
Central configuration for custom search criteria.
| JSON representation | 
|---|
| { "mappedFields" : [ string ] } | 
| Fields | |
|---|---|
| mappedFields[] |   Each mapped_field corresponds to a UGA key. To understand how this property works, take the following example. In the SearchConfig table, the user adds this entry: searchConfig { name: "person" searchCriteriaProperty { mappedFields: "player" mappedFields: "coach" } } Now, when a user issues a query like: criteria { field: "person" textArray { txtValues: "Tom Brady" txtValues: "Bill Belichick" } } MWH search will return search documents where (player=Tom Brady || coach=Tom Brady || player=Bill Belichick || coach=Bill Belichick). | 
| Methods | |
|---|---|
|   | Creates a search configuration inside a corpus. | 
|   | Deletes a search configuration inside a corpus. | 
|   | Gets a search configuration inside a corpus. | 
|   | Lists all search configurations inside a corpus. | 
|   | Updates a search configuration inside a corpus. | 

