ESearch is a simple search module for Sitecore XP. This project is created as a submission for konabos Search UI Competition.
Warning: This software is still in the beta stage.
- Sitecore Experience Platform 9.2
- Download the package
ESearch-{version}.zip
from here. - Install the package into your Sitecore via Installation Wizard.
ESearch provides a sample website built with this module & Bootstrap 4.
To install the sample website:
- Install the ESearch module.
- Install
ESearch - Sample Website-{version}.zip
(available in the release page). - Execute site publishing.
- Rebuild
sitecore_master_index
andsitecore_web_index
. - Add a bind
esearch.example.com:80
to your site on IIS. - Add a DNS record
127.0.0.1 esearch.example.com
to thehosts
file. - Access to
http://esearch.example.com
and enjoy it!
This module contains the following components.
- Search Results
- Search Result Summary
- Page Selector
- Facet Filter
- Sort Indicator
- Search Box (supports typeahead suggestion)
NOTE
You can see how to use these components on YouTube.
These components have the CSS classes based on Bootstrap 4 in its HTML, but it's not required. You can use your own styles if you want.
All components need to set a Search Settings
item in the rendering parameter. The Default Search Settings
is used by default.
Search Settings
:- Path: /sitecore/templates/Foundation/ESearch/Indexing/Search Settings
Default Search Settings
:- Path: /sitecore/system/Settings/ESearch/Search Settings/Default Search Settings
The Search Settings
has following search options.
Field name | Description |
---|---|
Scope |
Root item for filtering the search results. |
Target templates |
Templates for filtering the search results. |
Page Size |
Number of items displayed in the search results component per page. |
Keyword Search Targets |
Fields used in the keyword search. This affects search performance, so less is better. |
Date Format |
Date format used for displaying date. |
The Search Results component shows the results of searching.
A result item uses the Search Result Data
template for displaying its information. Set this to your Base template
field of the page template.
- /sitecore/templates/Feature/ESearch/Search Results/Search Result Data
- Path: /sitecore/templates/Feature/ESearch/Search Results/Search Results
Field name | Description |
---|---|
Read More Label |
Text displayed on the "Read more" link in each result item. |
- Path: /sitecore/templates/Feature/ESearch/Search Results/Rendering Parameter/Search Results Parameters
Parameter name | Description |
---|---|
Item Css Class |
Class names that set to each result item. |
The Search Result Summary component shows the count of results and current search conditions.
Search conditions are not displayed by default.
- Path: /sitecore/templates/Feature/ESearch/Search Result Summary/Search Result Summary
Field name | Description |
---|---|
Total Count Label |
Text displayed on the title of count of result. |
Search Conditions Label |
Text displayed on the title of current search conditions. |
No rendering parameters in this component.
The Page Selector component shows the link list for pagination.
- Path: /sitecore/templates/Feature/ESearch/Page Selector/Page Selector
Field name | Description |
---|---|
Previous Link Label |
Text displayed on the link to the previous page. |
Next Link Label |
Text displayed on the link to the next page. |
First Link Label |
Text displayed on the link to the first page. If the text is empty, the link is hidden. |
Last Link Label |
Text displayed on the link to the last page. If the text is empty, the link is hidden. |
- Path: /sitecore/templates/Feature/ESearch/Page Selector/Rendering Parameter/Page Selector Parameters
Parameter name | Description |
---|---|
Selector Size |
Number of the page selector links displayed on both sides of a center link. |
The Facet Filter component shows the number of search results in a specific field.
- Path: /sitecore/templates/Feature/ESearch/Facet Filter/Facet Filter
Field name | Description |
---|---|
Header Label |
Text displayed on the header of the filter. |
Clear Label |
Text displayed on the clear button. |
- Path: /sitecore/templates/Feature/ESearch/Facet Filter/Rendering Parameter/Facet Filter Parameters
Parameter name | Description |
---|---|
Target Field |
Field for calculating the number of search results. |
NOTE
This component uses the dropdown component of Bootstrap. If you don't want to use Bootstrap, you need to create a script for displaying it as a dropdown. (Will be improved in a future version.)
The Sort Indicator has two dropdown lists for sorting the search results.
The first one shows the field choices which is for sorting specified in the Sort Fields
of the data source. The second one has "Ascending" or "Descending" choices and it is for specifying sort direction.
To add a field choice:
- Create a
Sort Field
item. - Input a field name for sorting in the
Field Name
. - Input a displayed label for the dropdown in the
Display Name
. - Set the item in the
Sort Fields
of the data source.
- Path: /sitecore/templates/Feature/ESearch/Sort Indicator/Sort Field
Field name | Description |
---|---|
Field Name |
Name of the field of the search target content. |
Display Name |
Name of display on dropdown list. |
- Path: /sitecore/templates/Feature/ESearch/Sort Indicator/Sort Indicator
Field name | Description |
---|---|
Sort Fields |
Sort Field items to display on the dropdown list. |
Default Text |
Text to display on the initial choice in the dropdown list. |
No rendering parameters in this component.
The Search Box is a component that helps the keyword search and provides suggestions.
You can search for the field that was set in Keyword Search Target
in Search Settings
.
NOTE
To enable typeahead suggestion, requierd to load /Scripts/esearch.searchbox.js
in your layout.
- Path: /sitecore/templates/Feature/ESearch/Search Box/Search Box
Field name | Description |
---|---|
Placeholder Label |
Text for display in the placeholder. |
Execute Button Label |
Text for display on the button that executes the search. |
No rendering parameters in this component.
The features below are not supported yet.
- Asynchronous update of the search results
- A range-based filter (ex: filter by price, date, etc.)
- Adding the components beyond a search page
- SXA Integrations
Your contribution and feedback are very welcomed.
- Make a feature in todo list
- Add unit testing
- Fix English in the documents or comments
- Add a sample theme without the Bootstrap
- Add a compatible rendering for each component
- Clone this repository.
- Build the solution and publish all projects to your Sitecore instance.
- Enable the
/App_Config/Include/ESearch.Foundation.Serialization.config.example
. (published one, not in the repository) - In the enabled file, change the value of
sourceFolder
setting to the cloned solution's/src
folder path. - Set the access (read and write) rights to an application pool of your Sitecore.
- Access to
{url to your sitecore}/unicorn.aspx
and sync all items.
This software is released under the MIT License, see LICENSE.txt.