When the basic search component can not keep up with the demand, Joomla Smart Search can be used as an enhanced alternative for this popular feature. It’s a must-have component for every Joomla site
This article will show you how to create and utilize Joomla Smart Search straight out of the core system.
Table of Content
What is Joomla smart search?
Joomla smart search enable search function for site visitors. And it’s more advanced than the normal search feature.
But how advanced is it?
Basically, Joomla smart search enables you to:
1. Command search option
A few example of how you can use the search feature
2. Autocomplete /As-you-type suggestion
3. Have more control over your search results and search filter: with smart search, you can create a filter with only the author name or category.
4. Search result contains more information: it has a URL and more text description.
How to create Joomla Smart Search?
To enable Joomla smart search in your site, you need to:
- Step 1: Enable Smart Search Plugin
- Step 2: Run Indexer
- Step 3: Display on frontend
- Configure Smart Search Setting (Optional)
Step 1: Enable Smart Search Plugin
For the smart search to work, you have to enable the Content - Smart Search plugin. To do that, you can follow these steps:
- Go to Extension -> Plugins
- In the search bar, enter “smart search”
- Enable the “Content - Smart Search” plugin
You can also enable all the related plugins (Categories, contacts, content, etc), they give you extra searching options, however, it depends entirely on your usage.
Step 2: Run Indexer
After enabling all the necessary plugins, you need to run the Smart Search Indexing. This will scan all your website data to prepare for an advanced search.
-
- Go to Components -> Smart Search
- Go to Indexed Content section
- Click “Index”
Note:
- Depending on your collective site data, it might take from a few minutes to a few hours to complete the process.
- If your website is too large, then you ought to read this guide to utilize the process.
- If there is any content you don’t want to appear in your smart search, you can unpublish it by clicking the “tick" icon in the Status column.
Step 3: Display Joomla Smart Search on the frontend
To display on your site, you can choose one of the following options:
- Option 1: Through the Smart Search Module
- Option 2: Through the Menu Items Type - Smart Search
Note: there will be a slight difference between the two options. You can check out the details here.
Option 1: Display through the Smart Search Module
- Step 1: Go to Extensions -> Modules -> Create New
- Step 2: Choose Smart Search Module
- Step 3: Fill in the Title and assign a position to the module
- Step 4: Change the Status to Published and hit Save.
Configure Smart Search in the module
All the settings for the smart search module are quite straight forward, they will affect your design for the most part. You can read all about its definition when hovering over it or test it for yourself.
However, you need to pay attention to this field:
+ Search filter: None is the default, and you should stick to it this way. However, if you have configured the Search Filter in Componets_Smart Search, you will have another option to choose from. We will explain in the below section.
After all, this is your smart search module will look like this in the frontend:
Option 2: Display through Menu Item Types
- Step 1: Go to Menu -> Main Menu (or any menu) -> Add New Menu Items
- Step 2: In Menu Items Type field -> Select Smart Search - Search type
- Step 3: Fill in the title and choose its parent items
- Step 4: Change the Status to Published and hit Save.
Configure Smart Search in menu item types
In the Details tab, you can fill in the Search Content Maps field. Then, when clicking on the Smart Search menu, the page result always displays the result with the keyword you filled in.
For example, if “Joomla” is chosen, the result page will initially show all the results with the “Joomla” keyword.
Your smart search displaying through menu item will look like this in the frontend:
The difference between displaying through Module and Menu Items
This table shows the settings that the module and menu items search bar have.
Module
|
Menu Items
|
- Search Field Label
- Label Position
- Alternative Label
- Search Button
- OpenSearch Autodiscovery
- OpenSearch title
- Set ItemID
|
|
Despite the difference between the settings in the module and menu items, you can control the smart search settings mainly through the Global Configuration settings.
General Settings
- Step 1: Go to System -> Global Configuration
- Step 2: Find Smart Search
The first tab is where you can handle all the settings.
Note: the settings will affect both module and menu items, however in the case of menu items, you can override the configuration within the menu item settings.
Some notable settings you should pay attention to:
+ Gather Search Statistics: Enable this will allow you to see all the search query your visitor has put in. It will bring you a great insight into what the customers actually want to see, so you can improve your content and site.
To see the search query, you need to go: Components -> Search.
+ Allow Empty search: this is only enabled when you create and select a Search Filter view. It will display all the search results in that filter whenever the search query results in none.
Indexing is an important part of setting up Smart Search, it will determine how fast the indexing process is. To configure it, you need to follow these steps:
- Step 1: Go to System -> Global Configuration
- Step 2: Find Smart Search
- Step 3: Go to Index Tab
+ Indexer Batch Size: By default, it goes to 50, it means that 50 content items will be indexed per batch. Increasing this setting will make the process faster, but it also uses more memory and possibly more temporary disk space.
+ Memory Table Limit: should not be changed unless you encounter the Table Full error. When getting the error, reduce the default number.
Configure Search Filter
The Search Filter determines which data can be searched and which will be left out. The filter will range from 4 areas:
- Author
- Language
- Category
- Type
To make a new search filter, you need to follow these steps:
- Step 1: Go to Components -> Smart Search
- Step 2: Go to Search Filter and create New
- Step 3: Choose your filter options and Save
Note: you need to fill in the Search Filter field when displaying smart search over the module or menu item types.
Smart Search fits with most Joomla sites - it’s very useful and easy to use. We hope with this article you better understand how to create a Joomla Smart Search and configure the components to suit your needs.