Shopware icon

Shopware

Shopware

Actions778

Media → Search Media

AI-generated

Overview

This node operation performs a search query on media resources within the Shopware platform. It allows users to retrieve media items based on various search parameters such as pagination, filtering, sorting, and field selection. This is useful for scenarios where you need to programmatically access media assets stored in Shopware, for example, to display media in a custom frontend, synchronize media data with another system, or analyze media metadata.

Use Case Examples

  1. Retrieve the first page of media items with a limit of 20 items per page.
  2. Search media items filtered by specific criteria such as media type or creation date.
  3. Sort media results by upload date or name.
  4. Fetch only specific fields of media items to optimize data transfer.

Properties

Name Meaning
Page The page number of the search results to retrieve, used for pagination.
Limit The number of media items to return per page in the search results.
Filter A JSON array of filters to restrict the search results based on specific criteria.
Sort A JSON array defining the sorting order of the search results.
Post Filter Filters applied after aggregations that do not affect the aggregation results.
Associations JSON object defining related entities to include in the search results.
Aggregations A JSON array specifying aggregations to perform on the search results.
Grouping A JSON array to perform groupings over certain fields in the search results.
Fields A JSON array specifying which fields should be returned in the search results.
Total Count Mode Option to determine how the total number of hits is calculated for the search query. Options include none (disabled), exact (slow but accurate), and next-pages (fast for next page only).
Ids A JSON array of specific media IDs to search for.
Includes JSON object specifying fields to include for given entities, used to control returned data at the API level.
Request Options Settings for request behavior such as batching, SSL certificate validation, proxy usage, and timeout.

Output

JSON

  • data - The array of media items returned by the search query.
  • total - The total number of media items matching the search criteria, if total count mode is enabled.
  • aggregations - Aggregation results if aggregations were requested in the search.

Dependencies

  • An API key credential for Shopware Admin API authentication

Troubleshooting

  • Ensure the API credentials are correctly configured and have permissions to access media resources.
  • Verify that JSON inputs for filters, sorting, and other parameters are correctly formatted to avoid parsing errors.
  • If the total count mode is set to exact, expect slower response times for large datasets.
  • Check network settings if using proxy or if SSL certificate validation is disabled, as these can affect connectivity.

Links

Discussion