Advanced Search
Unified search with refinement filters, typeahead, and multiple result templates.
Component Consolidation
Advanced Search consolidates the legacy Search Box and Search Refinement web parts into a single, unified component.
Get Advanced Search Working in 3 Steps
Prerequisites
- Bonzai 2 package installed on your site
- SharePoint Search configured and indexing content
Create a Search page
Create a new page named "Search" with a full-width layout.
Add the Advanced Search web part
Edit the page, click +, search for "Advanced Search", and add it to the full-width section.
Configure refiners and publish
Open the property pane, configure the search scope, set refinement categories, choose a result template (Classic is the default), and publish.
When to Use This Web Part
Use this when you need to...
- Create a centralized enterprise search page
- Provide users with refined search across all content
- Enable filtering by content type, date, author, and custom metadata
- Replace the classic Bonzai header search experience
- Build category-specific search pages (documents, people, news)
Best page locations
- Search Center page — dedicated enterprise search
- Site homepage — embedded search experience
- Content-specific pages — filtered search (e.g., "Search Policies")
Consider alternatives when...
- • Simple document search — use Document Portal for document-focused search
- • People search only — use Employee Directory
- • News search only — use News Rollup with filtering
Related web parts:
Step-by-Step Configuration
Create a new Search page
Add the page to your site navigation for easy access.
Add a full-width section
Add the Advanced Search web part
Configure search scope and filters
Use the Content Type picker to select which content types appear in the filter dropdown.
Set items per page and default view
Configure display options
Publish and test
Common Configurations
Copy these ready-to-use configurations:
Enterprise Search Center
Full-featured search for all site content
| title | Search |
| autoDetectScope | Off |
| refinersConfig | Content Type:contentclass:;File Type:FileType:;Author:Author: |
| itemsPerPage | 20 |
| defaultView | Classic |
| showRefiners | On |
| showViewSwitcher | On |
Document Search
Focused search for documents only
| title | Find Documents |
| allowedContentTypes | STS_ListItem_DocumentLibrary |
| allowedFileTypes | docx,xlsx,pdf,pptx |
| refinersConfig | File Type:FileType:;Author:Author: |
| defaultView | List |
Homepage Search Widget
Compact search for homepage integration
| showSearchBox | On |
| showInlineFilters | Off |
| showSortDropdown | Off |
| showRefiners | Off |
| itemsPerPage | 5 |
| chromeType | None |
Site-Wide Search
Comprehensive search with all refiners
| title | Enterprise Search |
| refinersConfig | Content Type:contentclass:;File Type:FileType:;Author:Author: |
| itemsPerPage | 20 |
| defaultView | Cards |
| showViewSwitcher | On |
| showRefiners | On |
Recent Updates
- Fixed: all four result templates (Card, Classic List, List, Table) now honour the Open in New Tab toggle and add
data-interception="off", so SharePoint's link interceptor no longer hijacks navigation from search results. - New: Date Field control under Result Display → Show Result Published lets authors choose which managed property's date drives the displayed published date (Auto/Created, Created, Last Modified, or Write).
- New: Classic result template with rich metadata (category, views, tags, thumbnail, author, likes & comments, published date) — now the default view.
- New: inline filter row above results — Content Type (multi-select), Author, Date, and Tags text fields.
- New: Sort dropdown — Relevance, Most Recent, or Most Viewed.
- New: typeahead suggestions — live result previews after 2+ characters, powered by the SharePoint Search query API (not the legacy suggestions endpoint).
- New: sub-site scoping with auto-detect toggle (limits search to the current site).
- New: Content Type picker in the property pane — select content types and assign friendly labels for end-user filters.
- New: page exclusions by URL or GUID (exclude specific pages from results).
- New: prefix/wildcard search for partial matching (e.g., "comm" matches "communication").
- New: per-field result card toggles — hide category, views, tags, URL, thumbnail, author, likes/comments, or published date individually.
- Improved: property pane reorganized into two pages with collapsible accordion sections.
Sub-site Scoping
An auto-detect toggle scopes search results to the current site. When turned off, a manual scope field lets you enter a specific path. The scope is applied as a Path: KQL filter and also narrows typeahead suggestions.
Content Type Filters
Admins can select which content types appear in the end-user filter dropdown using a visual picker in the property pane (the contentTypeChoices property). Each content type can be given a friendly label (e.g., "Documents" instead of "STS_ListItem_DocumentLibrary"). End users see a multi-select dropdown in the inline filter row for narrowing results. This is separate from the allowedContentTypesproperty, which restricts which values appear inside the Content Type refiner in the side panel.
Inline Filters & Sort
A filter row sits directly above the results and exposes quick filters without opening the refinement panel: a multi-select Content Type dropdown (populated from your configured content type choices), an Author text field (prefix-matched), a Date picker (matched on LastModifiedTime for that day), and a Tags text field (comma- or semicolon-separated, matched against Tags andowstaxidmetadataalltagsinfo). A separate Sort dropdown offers Relevance, Most Recent, or Most Viewed ordering (recent and views are applied client-side).
Result Templates
Four built-in templates render the result list. Classic (default) shows a rich card per result with category label, view count, title, description, URL, tags, author/published date, and likes/comments, plus an optional thumbnail. List is a compact list with a file-type icon, title, description, author and date. Cards is a grid of tiles showing file-type badge, title, short description, author and date. Table renders Name, Type, Author and Published columns. The Show View Switcher toggle lets end users switch between these at runtime.
Page Exclusions
Exclude specific pages from search results by entering URLs or GUIDs. URL-based exclusions useNOT Path: KQL filters; GUID-based exclusions are applied client-side after results are returned (matched against DocId / UniqueId).
Best Practices
Use descriptive placeholder text
Configure relevant refiners
Create multiple search pages for different needs
Refiners require managed properties
Turn on the refinement panel and view switcher
showRefiners and showViewSwitcher default to Off so the web part renders as a compact list. On dedicated search pages, turn both on in the Display Settings group to give users the full refinement sidebar and the List / Cards / Table / Classic switcher.Reference
Technical details for developers and advanced users.
Consolidated Components
Advanced Search consolidates functionality from two legacy Bonzai components:
| Classic Component | Location | Function | Modern Equivalent |
|---|---|---|---|
| Search Box | Header (bonzai.min.js) | Search input with typeahead | Search input + typeahead suggestions + inline Content Type / Author / Date / Tags filters |
| Search Refinement | Search pages | Filtering panel with refiners and counts | Refinement sidebar (showRefiners) with configurable refinersConfig |
| Search Result Templates | bonzai.min.js | Result display formatting | Four built-in templates: Classic, List, Cards, Table — switchable at runtime via the view switcher |
Property Pane Configuration
Title & Branding
| Property | Type | Description |
|---|---|---|
title | Text | Web part title (default: Search) |
titleUrl | Text | Optional URL to make the title clickable |
titleIconOption | Dropdown | Title icon mode: custom (default) or none |
titleIconName | Text | Fluent UI icon name (e.g., Search, Zoom). Only shown when icon option is custom. Default: Search |
titleIconUrl | Text | Custom icon URL (overrides titleIconName when set) |
description | Text (Multiline) | Optional description below the title |
showMoreUrl | Text | URL for the footer link shown below the result list |
showMoreText | Text | Text for the footer link (default: View All Results) |
Search Scope
| Property | Type | Description |
|---|---|---|
autoDetectScope | Toggle | Scope search to the current site automatically (default: On). Applied as a Path: KQL filter. |
searchScope | Text | Manual search scope URL (only shown and used when auto-detect is Off) |
resultSourceId | Text | Optional SharePoint Search result source GUID. Leave empty to use Local SharePoint Results. |
Refiners Configuration
| Property | Type | Description |
|---|---|---|
refinersConfig | Text (Multiline) | Refiners in format "Label:Property:DefaultValue;..." (default: Content Type:contentclass:;File Type:FileType:) |
refinersSortOrder | Dropdown | Sort refiner values by count (default) or alphabetical |
maxValuesPerRefiner | Slider (5-50) | Maximum values to show per refiner (step: 5, default: 10) |
Content Type Configuration
| Property | Type | Description |
|---|---|---|
contentTypeChoices | Content Type Picker (JSON) | Content types to expose in the inline Content Type dropdown. Each entry has a value (contentclass) and alias (friendly label). Stored as a JSON array. |
Filter Restrictions
| Property | Type | Description |
|---|---|---|
allowedContentTypes | Text (Multiline) | Comma-separated contentclass values to show inside the Content Type refiner (empty = all). E.g., STS_ListItem_DocumentLibrary,STS_ListItem_WebPageLibrary |
allowedFileTypes | Text | Comma-separated file extensions to show inside the File Type refiner (empty = all). E.g., docx,xlsx,pdf,pptx |
Page Exclusions
| Property | Type | Description |
|---|---|---|
excludedPages | Tag Input (JSON array) | URLs or GUIDs of pages to exclude from results. URLs become NOT Path: KQL filters; GUIDs are matched client-side against DocId / UniqueId. |
Display Settings
| Property | Type | Description |
|---|---|---|
defaultView | Dropdown | Default result view: list, cards, table, or classic (default) |
itemsPerPage | Slider (5-50) | Results per page (step: 5, default: 20) |
showSearchBox | Toggle | Show the search input box and typeahead (default: On) |
showInlineFilters | Toggle | Show the inline filter row (Content Type, Author, Date, Tags) above results (default: On) |
showSortDropdown | Toggle | Show the Sort By dropdown next to the search box — Relevance, Most Recent, Most Viewed (default: On) |
showRefiners | Toggle | Show the refinement filters sidebar (default: Off) |
showViewSwitcher | Toggle | Show the List / Cards / Table / Classic view switcher (default: Off) |
showMetadata | Toggle | Show metadata on search results (default: On) |
showAuthor | Toggle | Show author name on search results (default: On) |
openInNewTab | Toggle | Open search results in a new browser tab (default: Off) |
Result Card Details
These toggles control which metadata appears on each search result. The showResultCategory,showResultViews, showResultTags, showResultUrl,showResultThumbnail, and showResultLikesComments fields are only rendered by the Classic template; the other templates display a subset.
| Property | Type | Description |
|---|---|---|
showResultCategory | Toggle | Show the category label above the result title (Classic only, default: On) |
showResultViews | Toggle | Show the view count badge on each result (Classic only, default: On) |
showResultTags | Toggle | Show tag chips under each result (Classic only, default: On) |
showResultUrl | Toggle | Show the result URL under the title (Classic only, default: On) |
showResultThumbnail | Toggle | Show the preview thumbnail when available (Classic only, default: On) |
showResultAuthor | Toggle | Show the author name on each result (all templates, default: On) |
showResultLikesComments | Toggle | Show like and comment counts (Classic only, default: On) |
showResultPublished | Toggle | Show the published / modified date on each result (all templates, default: On) |
dateFieldName | Dropdown | Which managed property's date to render as the published date when showResultPublished is on. Default: Auto (Created). Options are a fixed list — Auto (Created), Created, Last Modified, or Write — because Advanced Search uses the SharePoint Search API rather than a list schema. |
Appearance
| Property | Type | Description |
|---|---|---|
chromeType | Dropdown | Chrome type: none, titleOnly, borderOnly, or titleAndBorder (default) |
fixedHeight | Slider (0-800) | Fixed height in pixels; 0 = auto (step: 50, default: 0) |
Features Checklist
- ✅ Search input box with prefix/wildcard matching (auto-appends
*for simple queries) - ✅ Typeahead — live result suggestions after 2+ characters, debounced 200 ms
- ✅ Inline filter row — Content Type (multi-select), Author, Date, Tags
- ✅ Sort dropdown — Relevance, Most Recent, Most Viewed
- ✅ Refinement sidebar — multi-select filters with value counts, expand/collapse, show more/less
- ✅ Clear all filters button
- ✅ Four result templates — Classic (default, rich metadata), List, Cards, Table
- ✅ Per-field toggles for category, views, tags, URL, thumbnail, author, likes/comments, published date
- ✅ Pagination (Previous / Next with page count)
- ✅ Sub-site scoping with auto-detect toggle or manual path
- ✅ Content type picker with friendly labels (
contentTypeChoices) - ✅ Allowed content type / file type restrictions on refiner values
- ✅ Page exclusions by URL (
NOT Path:) or GUID (client-side) - ✅ Optional result source ID (GUID) and show-more footer link
- ✅ Chrome options (None / Title Only / Border Only / Title and Border) and fixed height
- ✅ Property pane organized into two pages with collapsible accordion groups
Implementation Changes
| Aspect | Classic | Modern |
|---|---|---|
| Technology | bonzai.min.js + JSOM | SPFx + React |
| Search Input | Header integration | Standalone or embedded |
| Typeahead | Brick configuration | Property pane |
| Refinement | Separate component | Integrated panel |
| Refiners | CAML-based | SharePoint Search REST API |
Migration Benefits
- Flexibility: Can be placed on any Modern page
- No Master Page: Works without customization
- Unified Experience: Single web part for complete search
- Property Pane: No Brick login required for configuration
- Real-time Preview: See changes immediately while editing