By Dan Atrill on Monday, 20 November 2023
Category: November

Explore the Core - Smart Search and Search results settings

Search is such an important part of a website especially when there is a large amount of content. It helps improve engagement, or dwell-time as it’s sometimes known. Most of all it makes the site user-friendly as it helps visitors find what they’re looking for.

Smart Search has been in Joomla since version 3. I’m using it in Joomla 5’s function-filled version that can be found under Components, and can also added as a site module.

What is so smart about this search function is that it indexes all content making search very quick. It lists all pages indexed in the component and can record what users have searched for.

Things I like about Smart Search are:

Things to look out for:

I like the suggestion dropdown that appears under the search box. In some templates this can appear faded out however. In my site I get black text with a yellow highlight.

Make A Search Results Page

In the Site Module, the final option says “Set ItemID” and this allows you to target a particular page to show search results. I found this really helpful with YooTheme where I could make a template that worked with the search results.

 

What are Custom Filters?

Creating Custom Filters is really useful if you want users to only search within one part of the site, ie Blog Articles. This can be implemented using the Smart Search module.

To create a Custom Filter go to Components > Smart Search > Filters then click “Add A Filter”

I have created a filter to search only within one category, which is helpful to contain results such as Blog content. It also works for other types of content, such as Events.

 

Some templates such as YooTheme include a search position in the header. In any case search would usually appear near the top of the page. However, if you’re using a search specific to an area of the website it may be necessary to label it clearly to avoid confusion. ie Search Blog

Further configuration

Types of search / matching can be configured in Options and includes:

This can make searches much more specific so be careful as you may end up with far fewer results than you expected. In fact it’s worth testing all the options at least once. You’d be surprised what words may get unexpectedly matched. I’m sure you can think of a few examples.

Advanced Search and other features

You’re probably familiar with Advanced Search in search engines or other software. It allows for more granular searches including filters on author, language, category. This feature can be toggled in the Options > Smart Search

Customising search results

We often think of search results as the SERP that Google or similar search engines give us. These include a page title, article date, a text excerpt / meta description. By default my experience with Smart Search also includes the document type, and the category that it is saved under.

Smart search gives us some helpful options to customise search results beyond this default.

Bear in mind that some articles may not have an Intro Image set under the Images and Links tab of the article. Also, depending on the Search Results page itself, the image may look like it belongs to the previous result.

It’s possible to show / hide images, the result URL and other data so the result is one long list of article titles, but this isn’t very user-friendly. It does however mean as the website admin you can configure the results view within the Smart Search: Options.

Smart Search Options also includes an Image Class which makes the resulting image stylable and containable. I found it showed me images to the size they’d been uploaded so some were quite small, others much larger.

Gotcha: I found the image didn’t show in search results on my test site and looking in the Dashboard could see I had Search and Smart Search enabled. I thought this was because I had upgraded from Joomla 3 to 4 to 5 and in the Smart Search Quick Start Guide it says: “Smart Search does not interact with the old Joomla search system and exposing both systems may create a negative user experience by giving inconsistent and confusing search results.” However, after testing everything I could think of, I finally found that images didn’t show if they’d been uploaded with a space in the filename. ie the file path included %20. When I replaced spaces or closed the gap, the image appeared OK.

I have opened an issue about this on GitHub if anyone wants to investigate this further.

Further Customisation

If I wanted to I could further override appearance my search results appearance using an HTML override and this would help the overall layout. If showing images in the search results, for example, I might want to create a grid layout either or equal height or in the currently-popular masonry style. This is achievable in a template editor such as YooTheme but can also be done by changing the code in the com_finder template file and adding it to the html of the template.

Making Site Search Work For You

With such a configurable component, Smart Search can create search results that look right for your website and enhance the user experience.

Leave Comments