younifyd
Menu

Post Multi Search

Multi-search

POST/pcm/catalog/multi-search

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Post Multi Search action (under Catalog Search).
  3. Fill in the fields below, then reference the result from later steps as {{postMultiSearch.response.data}}.

Request

Query parameters

includearray<string>

Using the include parameter, you can retrieve top-level resources. - Files or main image. For example, `include=files,main_image`. - Component product data. For example, `include=component_products`. - Key attribute data, such as SKU or slug.

search_profilestring

The slug of the search profile to use for this search. On shopper search (`/pcm/catalog/search`, `/pcm/catalog/multi-search`): used only when the matched catalog rule has no valid `search_profile_slug`. When the catalog rule carries a non-blank slug that resolves to a profile, that rule profile is used and this query parameter is silently ignored. Blank or whitespace-only values are treated as omitted. An invalid non-blank slug returns 400 with detail `Search profile '{slug}' not found`. On admin search (`/pcm/catalogs/{catalog_id}/releases/{release_id}/…`): catalog rule profiles are not applied. Resolution is this query parameter, then the tenant default profile, then the built-in default. Omit this parameter to use the tenant default profile (or the built-in default when no tenant default exists). The applied slug is returned in the `EP-Search-Profile` response header.

Headers

accept-languagestring

The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).

EP-Channelstring

The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests.

EP-Context-Tagstring

Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header.

x-moltin-currencystring

The currency used to resolve product price. If not supplied, the organization/store default currency is used.

EP-Simulated-Shopper-Datestring

Request body

Enter the body as JSON in the step's Body field.

searchesarray<object>required
typestring

Type of search operation to perform

One ofsearchautocomplete

highlight_full_fieldsstring
qstring
facet_bystring

Specifies which fields to use for generating facets in search results. See [faceting](/guides/How-To/Catalogs/Search/faceting) for more details.

filter_bystring

Applies conditions to narrow down search results based on specific field values. See [filtering](/guides/How-To/Catalogs/Search/filtering) for more details.

sort_bystring

Orders search results by specified fields. See [sorting](/guides/How-To/Catalogs/Search/sorting) for more details.

max_facet_valuesinteger
pageinteger
per_pageinteger
json
{
  "searches": [
    {
      "type": "search",
      "highlight_full_fields": "name,description",
      "q": "search query",
      "facet_by": "meta.search.nodes.name",
      "filter_by": "meta.search.nodes.name:=Electronics && price.float_price:>=10.00",
      "sort_by": "price.amount:asc,extensions.products(Specification).rating:desc",
      "max_facet_values": 10,
      "page": 1,
      "per_page": 20
    }
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{postMultiSearch.response.data.<field>}}.

resultsarray<object>
typestring

Type of search operation to performed

One ofsearchautocomplete

facet_countsarray<object>4 fields
foundinteger
hitsarray<object>4 fields
out_ofinteger
pageinteger
request_paramsobject
search_cutoffboolean
search_time_msinteger
includedobject

Included is an array of resources that are included in the response.

json
{
  "results": [
    {
      "type": "search",
      "facet_counts": [
        {
          "counts": [
            {
              "count": null,
              "highlighted": null,
              "value": null
            }
          ],
          "field_name": "category",
          "sampled": false,
          "stats": {}
        }
      ],
      "found": 150,
      "hits": [
        {
          "document": null,
          "highlight": {},
          "highlights": [
            {}
          ],
          "text_match_info": null
        }
      ],
      "out_of": 150,
      "page": 1,
      "request_params": {},
      "search_cutoff": false,
      "search_time_ms": 25
    }
  ],
  "included": {}
}

Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.