search_facets
¶
search_facets(
*,
config_overrides: Optional[MarketplaceDiscoveryClientConfig] = 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
Returns 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) –A BCP 47 language tag or comma-separated priority list specifying the preferred locale for response content. See
Localefor supported values, constraints, fallback behavior, and the default locale. If omitted, 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. Multiple filters are combined with AND logic. Multiple values within the same filter are combined with OR logic.
-
facet_types(Optional[FacetTypeList], default:None) –A list of specific facet types to retrieve. If empty or null, all available facets are returned.
-
next_token(Optional[NextToken], default:None) –If
nextTokenis returned, there are more results available. Make the call again using the returned token to retrieve the next page.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action.
-
InternalServerException–Unexpected error during processing of the request.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by the service.
-
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
>>> 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
>>> 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'])
Source code in docs_src/capo_marketplace_discovery/_services/marketplace_discovery.py
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 | |