Appearance
Troubleshooting
A block shows no results or options. The block is outside a search root. Place the block in a region of a Search Web Components layout. For every way to get a search root, see How a search page works. The Search Box block is the one block that works outside a search root.
The search works for you but fails for visitors. The visitors' roles lack the endpoint's permission. On People › Permissions, check Use search with [endpoint label] endpoint for Anonymous user and Authenticated user.
Results are counted but not shown. Common causes:
- No result element row matches the results. Add a row for All values under the endpoint's Result elements.
- The row names a custom element whose JavaScript is not on the page. Load the JavaScript from your theme or module.
The browser console logs "No element mapping found for:" with each result that no row matches. For the result element mapping settings, see Result elements.
Results show as JSON. The matching row uses
search-result-element-default, which a new endpoint starts with. Change the row tosearch-result-element-renderedwith a Field to render, or to a custom element. For the steps, see Indexing the rendered result.The page size is not what the layout says. The first search uses the endpoint's Limit. Set the layout's Default results per page to the endpoint's Limit. For every page size setting, see Page sizes.
A sort option does nothing. Common causes:
- The endpoint does not expose sorting. Make sure Expose sort is checked in the endpoint's Page group.
- A Sort block's Override available sorts row has an alias that is not defined in the endpoint's Sort options. Use an alias from the Sort options, or leave Alias empty.
- The option sorts by a field the index does not have. Pick a field in the index.
The grid listing layout renders results as a list instead of a grid. No result element row names the Grid listing layout, so the rows that apply to every listing layout render the results, with the element meant for the list. Add a row with When results are shown as set to Grid and the grid element under Displayed with. For the row settings, see Result elements.
The filter in Additional search params has no effect. The filter is written as the endpoint reads it, e.g.,
?f[0]=type:recipe. Write it as the page URL has it,?f[type]=recipe. The search root rewrites that form for the endpoint.A facet shows nothing. Common causes:
- The facet block or component names a facet key the endpoint does not have. Ensure the facet exists on the endpoint and is picked on the block or component.
- The layout's Additional search params applies every value of the facet, e.g.,
?f[type]=recipeon a facet whose only value isrecipe. A value applied that way is hidden from the facet, since visitors cannot remove it, and a facet with no value left shows nothing. Remove the filter from Additional search params, or remove the facet.