search_facets
async
¶
search_facets(
*,
config_overrides: Optional[AsyncMarketplaceDiscoveryClientConfig] = None,
locale: Optional[Locale] = None,
search_text: Optional[SearchText] = None,
filters: Optional[SearchFilterList] = None,
facet_types: Optional[FacetTypeList] = None,
next_token: Optional[NextToken] = None,
) -> SearchFacetsOutput
Retrieves the available facet values for filtering listings, such as categories, pricing models, fulfillment option types, publishers, and customer ratings. Each facet value includes a count of matching listings.
Parameters:
-
locale(Optional[Locale], default:None) –The preferred locale for response content, as a Best Current Practice 47 (BCP 47) language tag or a comma-separated priority list of language tags. See
Localefor supported values, constraints, fallback behavior, and the default locale. If you omit this field, the service returns content in the default locale. -
search_text(Optional[SearchText], default:None) –The search query text to filter listings before retrieving facets.
-
filters(Optional[SearchFilterList], default:None) –Filters to apply before retrieving facets. A result must match every filter. Within one filter, a result matches if it has any of the values.
-
facet_types(Optional[FacetTypeList], default:None) –The facet types to retrieve. If you omit this field or leave it empty, the service returns all available facets.
-
next_token(Optional[NextToken], default:None) –If the service returns
nextToken, more results are available. The value ofnextTokenis a unique pagination token for each page. Make the call again with the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. An expired pagination token returns aValidationException.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action. Verify that you have the required permissions.
-
InternalServerException–Unexpected error during processing of the request.
-
ThrottlingException–The request was denied due to request throttling. Reduce the frequency of your requests and retry.
-
ValidationException–The input fails to satisfy the constraints specified by the service. Check the
reasonfield for the constraint that failed. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Get facets for machine learning category Retrieve available facet values for listings in the machine learning category
>>> await client.search_facets(locale='en-US', search_text='analytics', filters=[{'filterType': 'CATEGORY', 'filterValues': ['machine-learning']}], facet_types=['FULFILLMENT_OPTION_TYPE', 'PRICING_MODEL'])
Get facets with term and rating range filters
Retrieve facets for security listings with ratings between 3.0 and 5.0 stars
>>> await client.search_facets(locale='en-US', filters=[{'filterType': 'CATEGORY', 'filterValues': ['security']}, {'filterType': 'MIN_AVERAGE_CUSTOMER_RATING', 'filterValues': ['3.0']}, {'filterType': 'MAX_AVERAGE_CUSTOMER_RATING', 'filterValues': ['5.0']}], facet_types=['PRICING_MODEL', 'AVERAGE_CUSTOMER_RATING'])
Get specialization facets
Retrieve specialization and specialization category facets for listings that earned the Travel and Hospitality Services Competency
>>> await client.search_facets(locale='en-US', filters=[{'filterType': 'SPECIALIZATION', 'filterValues': ['spec-0ae8wm2xxde76e']}], facet_types=['SPECIALIZATION', 'SPECIALIZATION_CATEGORY'])
Get certification facets
Retrieve certification values available for filtering
>>> await client.search_facets(locale='en-US', facet_types=['CERTIFICATES'])
Get Trust Center availability facets
Retrieve Trust Center availability for filtering
Source code in docs_src/capo_marketplace_discovery/_services/async_marketplace_discovery.py
970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 | |