5 minutes reading time (1089 words)

Explore the Core - Smart Search and Search results settings

October-SmartSearch

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:

  • You can create Custom Filters
  • You can configure it to show a select amount of detail in the the results
  • It has suggestions that appear under the search box as I type
  • I can see what visitors have searched for on the website (enable Logging under Options > Index)
  • It can highlight the search term in the result text if you have “Result Description” selected in Options
  • Search suggestions - the results page says: “Did you mean…” when there’s an empty result with a word that sounds like another such as water and weather

Things to look out for:

  • If you don’t match words exactly you may find results showing where one word is contained in another word ie “low tide” highlighted the word “plownose”
  • Searching within a custom filter might not reference articles outside of a category
  • Look at the search suggestion, if it’s turned on, for clues ie “Assuming low is required, and tide is required, the following result was found.”

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:

  • Whether to use Exact Word Match / Words beginning with the search term / Continuing the search term anywhere
  • Weighting of results by title text / body text / metadata
  • Filter out common words / numeric terms

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.

  • Include images
  • Show date
  • Result URL

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.

2
What is GPL, and why is it so important?
 

Comments 1

Already Registered? Login Here
Nelson Fernando Bautista Pinzon on Wednesday, 22 November 2023 17:51
Smart searches have to improve table consumption

Best regard.

Smart search is killing our websites, the tables fill up quickly and this means that smart search has not been a success but a huge problem.

Hopefully some user will tell us how we can configure the intelligent search so that the tables do not fill with terms and do not grow so fast, in truth many of us need some native and non-outsourced solution to this big problem, so there is no hosting or database that Hang on, Joomla needs to rethink the issue of smart searches taking up space in mysql, making them "not so smart" if it is to save space in our database.

Ironically, this problem did not exist in Joomla 3, the searches did not take up as much space in the tables and barely took up any space, but since Joomla 4 implemented these searches, they are literally killing websites, especially news sites that generate many articles.

Thank you all very much for responding to this kind and respectful suggestion.

0
Best regard. Smart search is killing our websites, the tables fill up quickly and this means that smart search has not been a success but a huge problem. Hopefully some user will tell us how we can configure the intelligent search so that the tables do not fill with terms and do not grow so fast, in truth many of us need some native and non-outsourced solution to this big problem, so there is no hosting or database that Hang on, Joomla needs to rethink the issue of smart searches taking up space in mysql, making them "not so smart" if it is to save space in our database. Ironically, this problem did not exist in Joomla 3, the searches did not take up as much space in the tables and barely took up any space, but since Joomla 4 implemented these searches, they are literally killing websites, especially news sites that generate many articles. Thank you all very much for responding to this kind and respectful suggestion.

By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/