sxa-search

Query Sitecore SXA native search endpoints and build rendering variants for results.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/gweone/agent-plugins --skill sxa-search-gweone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sxa-search
Source: https://github.com/gweone/agent-plugins/tree/main/plugin/sharpps-sitecore/skills/sxa-search
Command: npx skills add https://github.com/gweone/agent-plugins --skill sxa-search-gweone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with Sitecore SXA's native search Web API requires deep knowledge of undocumented query string parameters, server-side index resolution, and rendering variant mechanics that are easy to get wrong. ## Core Features & Use Cases - Endpoint Reference: Documents the /sxa/search/results, /sxa/search/facets, and /sxa/search/suggestions routes with every query string parameter, model binding, and response shape. - Index Resolution Internals: Explains how IIndexResolver, sc_site, sc_database, and the contentSearch.getContextIndex pipeline determine which index is queried, including the BucketableIndexResolver per-item override pattern. - Variant Workflow: Guides creation of search result Rendering Variants (including Component Variant Fields backed by Controller Renderings) via SPE remoting, from spec through execution. - Use Case: You need to add a filtered, paged search results widget to an SXA site and render each result with custom markup; this Skill gives you the exact query parameters, scope item setup, and variant item IDs to wire it up. ## Quick Start Use the sxa-search skill to call /sxa/search/results on my SXA site with a search term, paging, and a rendering variant, then create the variant item if it does not exist.

Frequently Asked Questions about sxa-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query the Sitecore SXA search API?

Call /sxa/search/results with query string parameters like q for the search term, s for scope item IDs, p for page size, e for offset, and v for the rendering variant ID. The endpoint is Web API based, accepts query strings only, and returns JSON.

How do I filter SXA search results by facet?

Add a query string parameter whose key matches the Facet item's own Sitecore item name under the site's Settings/Facets folder, with the filter value. ApplyFacetFilters reads these on every request, so filters narrow both results and facet counts.

Can I specify which search index SXA uses?

No query string parameter selects an index directly. Index resolution is server-side via IIndexResolver, using the context item's site indexes property, then sitecore_sxa_{db}_index, then page-mode defaults. The sc_database switch only works for authenticated administrators.

Why does sc_database not work on my SXA search request?

The sc_database switch is gated by Sitecore's DatabaseResolver and only applies when the request is authenticated as an Administrator or Sitecore Client Users member. Anonymous requests silently ignore it, so use an authenticated session such as New-SitecoreSession in PowerShell.

Why is my SXA search result Html empty when using a view rendering?

The search endpoint runs as a Web API request, so rendering a View Rendering outside a page request can throw an InvalidOperationException that gets swallowed into empty output. Use a Controller Rendering for Component Variant Fields instead.