Skip to content

search_listings async

search_listings(
    domain_identifier: DomainId,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    search_text: Optional[str] = None,
    search_in: Optional[SearchInList] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
    filters: Optional[FilterClause] = None,
    aggregations: Optional[AggregationList] = None,
    sort: Optional[SearchSort] = None,
    additional_attributes: Optional[SearchOutputAdditionalAttributes] = None,
) -> SearchListingsOutput

Searches listings in Amazon DataZone.

SearchListings is a powerful capability that enables users to discover and explore published assets and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. SearchListings also supports filtering using various criteria such as creation date, owner, or status. This API is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.

SearchListings returns results in a paginated format. When the result set is large, the response will include a nextToken, which can be used to retrieve the next page of results.

The SearchListings API gives users flexibility in specifying what kind of search is run.

To run a standard free-text search, the searchText parameter must be supplied. By default, all searchable fields are indexed for semantic search and will return semantic matches for SearchListings queries. To prevent semantic search indexing for a custom form attribute, see the CreateFormType API documentation. To run a lexical search query, enclose the query with double quotes (""). This will disable semantic search even for fields that have semantic search enabled and will only return results that contain the keywords wrapped by double quotes (order of tokens in the query is not enforced). Free-text search is supported for all attributes annotated with @amazon.datazone#searchable.

To run a filtered search, provide filter clause using the filters parameter. To filter on glossary terms, use the special attribute __DataZoneGlossaryTerms. To filter on an indexed numeric attribute (i.e., a numeric attribute annotated with @amazon.datazone#sortable), provide a filter using the intValue parameter. The filters parameter can also be used to run more advanced free-text searches that target specific attributes (attributes must be annotated with @amazon.datazone#searchable for free-text search). Create/update timestamp filtering is supported using the special creationTime/lastUpdatedTime attributes. Filter types can be mixed and matched to power complex queries.

To find out whether an attribute has been annotated and indexed for a given search type, use the GetFormType API to retrieve the form containing the attribute.

Parameters:

  • domain_identifier (DomainId) –

    The identifier of the domain in which to search listings.

  • search_text (Optional[str], default: None ) –

    Specifies the text for which to search.

  • search_in (Optional[SearchInList], default: None ) –

    The details of the search.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return in a single call to SearchListings. When the number of results to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to SearchListings to list the next set of results.

  • next_token (Optional[PaginationToken], default: None ) –

    When the number of results is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of results, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to SearchListings to list the next set of results.

  • filters (Optional[FilterClause], default: None ) –

    Specifies the filters for the search of listings.

  • aggregations (Optional[AggregationList], default: None ) –

    Enables you to specify one or more attributes to compute and return counts grouped by field values.

  • sort (Optional[SearchSort], default: None ) –

    Specifies the way for sorting the search results.

  • additional_attributes (Optional[SearchOutputAdditionalAttributes], default: None ) –

    Specifies additional attributes for the search.

Raises:

Source code in docs_src/capo_datazone/_services/async_data_zone.py
async def search_listings(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    search_text: Optional[str] = None,
    search_in: Optional["capo_datazone.types.search_in_list.SearchInList"] = None,
    max_results: Optional["capo_datazone.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_datazone.types.pagination_token.PaginationToken"
    ] = None,
    filters: Optional["capo_datazone.types.filter_clause.FilterClause"] = None,
    aggregations: Optional[
        "capo_datazone.types.aggregation_list.AggregationList"
    ] = None,
    sort: Optional["capo_datazone.types.search_sort.SearchSort"] = None,
    additional_attributes: Optional[
        "capo_datazone.types.search_output_additional_attributes.SearchOutputAdditionalAttributes"
    ] = None,
) -> "capo_datazone.types.search_listings_output.SearchListingsOutput":
    """<p>Searches listings in Amazon DataZone.</p> <p>SearchListings is a powerful capability that enables users to discover and explore published assets and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. SearchListings also supports filtering using various criteria such as creation date, owner, or status. This API is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.</p> <p>SearchListings returns results in a paginated format. When the result set is large, the response will include a nextToken, which can be used to retrieve the next page of results.</p> <p>The SearchListings API gives users flexibility in specifying what kind of search is run.</p> <p>To run a standard free-text search, the <code>searchText</code> parameter must be supplied. By default, all searchable fields are indexed for semantic search and will return semantic matches for SearchListings queries. To prevent semantic search indexing for a custom form attribute, see the <a href="https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateFormType.html">CreateFormType API documentation</a>. To run a lexical search query, enclose the query with double quotes (""). This will disable semantic search even for fields that have semantic search enabled and will only return results that contain the keywords wrapped by double quotes (order of tokens in the query is not enforced). Free-text search is supported for all attributes annotated with @amazon.datazone#searchable.</p> <p>To run a filtered search, provide filter clause using the <code>filters</code> parameter. To filter on glossary terms, use the special attribute <code>__DataZoneGlossaryTerms</code>. To filter on an indexed numeric attribute (i.e., a numeric attribute annotated with <code>@amazon.datazone#sortable</code>), provide a filter using the <code>intValue</code> parameter. The filters parameter can also be used to run more advanced free-text searches that target specific attributes (attributes must be annotated with <code>@amazon.datazone#searchable</code> for free-text search). Create/update timestamp filtering is supported using the special <code>creationTime</code>/<code>lastUpdatedTime</code> attributes. Filter types can be mixed and matched to power complex queries.</p> <p> To find out whether an attribute has been annotated and indexed for a given search type, use the GetFormType API to retrieve the form containing the attribute.</p>

    Args:
        domain_identifier: <p>The identifier of the domain in which to search listings.</p>
        search_text: <p>Specifies the text for which to search.</p>
        search_in: <p>The details of the search.</p>
        max_results: <p>The maximum number of results to return in a single call to <code>SearchListings</code>. When the number of results to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>SearchListings</code> to list the next set of results. </p>
        next_token: <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>SearchListings</code> to list the next set of results.</p>
        filters: <p>Specifies the filters for the search of listings.</p>
        aggregations: <p>Enables you to specify one or more attributes to compute and return counts grouped by field values.</p>
        sort: <p>Specifies the way for sorting the search results.</p>
        additional_attributes: <p>Specifies additional attributes for the search.</p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datazone.types.search_listings_input.SearchListingsInput]",
    ) -> AsyncOperationResponse[
        "capo_datazone.types.search_listings_output.SearchListingsOutput"
    ]:
        import capo_datazone._operations.data_zone.search_listings

        (
            output,
            http_response,
        ) = await capo_datazone._operations.data_zone.search_listings.async_search_listings(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_datazone.types.search_listings_output.SearchListingsOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.search_listings_output

        return capo_datazone.types.search_listings_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("SearchListings", redact_output=_redact_output),
    )
    input_: capo_datazone.types.search_listings_input.SearchListingsInput = {
        "domain_identifier": domain_identifier
    }
    if search_text is not None:
        input_["search_text"] = search_text
    if search_in is not None:
        input_["search_in"] = search_in
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filters is not None:
        input_["filters"] = filters
    if aggregations is not None:
        input_["aggregations"] = aggregations
    if sort is not None:
        input_["sort"] = sort
    if additional_attributes is not None:
        input_["additional_attributes"] = additional_attributes

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output