Shopware icon

Shopware

Shopware

Actions778

Document → Search Document

AI-generated

Overview

This node performs a search operation on documents within the Shopware platform. It allows users to query documents with various parameters such as pagination (page and limit), filtering, sorting, and grouping. The node supports advanced search features including post-filters, aggregations, and specifying which fields to return. It is useful for scenarios where users need to retrieve specific documents based on complex search criteria, such as filtering documents by attributes, sorting results, or limiting the fields returned for performance optimization.

Use Case Examples

  1. A user wants to retrieve the first page of documents with a limit of 10 items per page, filtered by a specific attribute.
  2. A user needs to sort documents by creation date and only return certain fields to optimize data transfer.
  3. A user wants to apply aggregations and groupings to analyze document data within Shopware.

Properties

Name Meaning
Page The page number of the search results to retrieve, used for pagination.
Limit The number of 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 A JSON array of filters applied after aggregations, which do not affect aggregation results.
Associations A JSON object defining associations to include in the search results.
Aggregations A JSON array defining aggregations to perform on the search results.
Grouping A JSON array defining groupings to perform 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: none (disabled), exact (slow but accurate), or next-pages (fast for next page only).
Ids A JSON array of specific document IDs to search for.
Includes A JSON object specifying fields to include for given entities, used to control returned data at the API level.

Output

JSON

  • data - The search results containing the documents matching the query.
  • total - The total number of documents matching the search criteria, if total count mode is enabled.

Dependencies

  • Shopware API credentials

Troubleshooting

  • Invalid JSON format in filter, sort, post-filter, aggregations, grouping, fields, ids, or includes properties can cause errors. Ensure JSON is correctly formatted.
  • Incorrect pagination values (page or limit) may result in empty or unexpected results. Verify these values are within valid ranges.
  • Using 'exact' total count mode may slow down the search operation significantly on large datasets.
  • Network or authentication issues with Shopware API credentials can cause request failures. Verify credentials and network connectivity.

Links

Discussion