Preparing SPARQUE Desk for Populating a Search Result Page
The Wrapper endpoint /search returns products, redirects, facets and/or sortings and is intended for populating a search result page.
In SPARQUE Desk, several endpoints are involved in this process. This page highlights the main endpoints:
- search
- facet_filter
- facet_options
- facets
For a comprehensive list, refer to the Required SPARQUE Desk Endpoints.
Endpoint search
This endpoint returns all product objects related to a specific search phrase, which must be provided via the keyword parameter. The channel parameter is typically required as well. For more advanced search strategies, the user can be included to personalize results based on past orders and a list of preselected products.
search/p/user/{STRING}/p/keyword/{STRING}/p/channel/{STRING}/p/cartId/{TUPLE_LIST} -> OBJExample of a SPARQUE request:
/1/workspace/api/PWA/c/locale/de-DE/c/channel/ish/c/keyword/black/e/search/results?config=defaultEndpoint facets
This stacked endpoint outputs all properties from the search results. For each property returned, the facet_options endpoint is called to retrieve the available values for that property. Since this endpoint is stacked on top of the search endpoint, no additional parameters besides locale are required.
OBJ -> facets/p/locale/{STRING} -> OBJExample of a SPARQUE request to return all facets based on a search call:
/1/workspace/api/PWA/c/locale/de-DE/c/channel/ish/c/keyword/black/e/search/e/facets/results?config=defaultEndpoint facet_options
This stacked endpoint returns all property value objects for a specific property. The property identifier must be provided as a string via the attribute parameter. The output is structured as OBJ,DOUBLE, where OBJ represents the property value and DOUBLE indicates the count of items in the result set.
OBJ -> facet_options/p/attribute/{STRING} -> OBJ,DOUBLEExample of a SPARQUE request to return options for a color facet:
/1/workspace/api/PWA/c/locale/de-DE/c/channel/ish/c/keyword/black/e/search/e/user_product_catalog/e/facet_options/p/attribute/Colour/results?config=defaultEndpoint facet_filter
This stacked endpoint filters the product list to include only those with properties matching the specified name and value. Multiple property values can be provided for filtering.
OBJ -> facet_filter/p/value/{TUPLE_LIST}/p/locale/{STRING}/p/attribute/{STRING} -> OBJExample of a SPARQUE request to apply a facet filter additionally to the keyword search:
/1/workspace/api/PWA/c/locale/de-DE/c/channel/ish/c/keyword/black/e/search/e/facet_filter/p/value/1(Gray)/p/attribute/Color/resultsUseful Guides
- For sorting options, refer to:
Defining Sorting Options in a Lister or Search Result Page - For redirects, refer to:
Setting Up Redirects for the SPARQUE Wrapper - To show masters, variants and/or products, refer to:
Working with Master and Variation Products - For search personalization, refer to:
Settings Through SPARQUE Hub | Search Personalization