Macrotone Blogs

Macrotone blogs upon Joomla, our products and other matters.

Implementing Smart Search

b2ap3 icon joomlaWe have changed the search mechanism on the site from the standard ‘Joomla Search’ to make use of ‘Smart Search’.

This will hopefully enable a ‘richer’ environment for our visitors.  The implementation itself was relatively painless. Our own Issue Tracker component, and the standard supplied components such as content etc. worked flawlessly ‘out of the box’.  In additional a finder plugin for our Blog was also found and implemented very easily.

Only our Forum component gave rise to any problems. It was necessary to prevent sh404SEF from interfering in the URL generation so that the Forum used the ‘standard Joomla router’ for its links. This also involved removing from the sh404SEF component all history of the forum component. Once this was done then it was plain sailing.

The only point that should be emphasised is that the ‘Smart Search’ does not make use of ‘wild card’ characters.  The ‘old’ Joomla search mechanism used a very primitive method of searching which relied on the FULLTEXT search provided by the database. This was very inefficient but provided a simple means of handling wildcard search queries. Smart Search provides an auto-complete feature which is effectively a wildcard search of terms in the index, but full wildcard searching is not supported due to the potential for crippling the server if the feature were to be abused. In most cases wildcard searching is used to cater for variations in a search term. For example, searching for "juggl*" in order to catch references to "juggling" as well as "juggler". Smart Search attempts to avoid the need for wildcard searching by instead supporting word stemming where words that have the same stem are considered equivalent so that searching for "juggler" will also retrieve instances of "juggling" without the need to use wildcards.

Joomla Smart Search

b2ap3 icon joomlaI have seen a number of posts on the web about the ‘Smart Search’ feature, most of which are about using it and configuring it.  My experience had found one peculiarity of using the feature on Joomla 2.5 which I am sure cannot just be me.

The peculiarity I refer to is the fact that it is ‘always’ necessary to create a menu item for the ‘Smart search’,  otherwise the search just directs one to the usual (old) search page.  It doesn’t matter if one disables the ‘old’ search plugin, one is still directed to the ‘old’ search result. This is something I first noticed with the initial release of Joomla 2.5, and put it down to a ‘quirk’, it being a ‘new’ feature, but it is still present even with the recent updates.

I have been unable to find any reference to this peculiarity anywhere, despite extensive searching (pun intended).  There is a brief reference to a menu item being required IF a search filter is used, but I have found it necessary even if a filter is not being used.

The only way in which I have managed to get it working every time is as follows:

Create a Menu Item from the "Smart Search" category. NOTE: there is a category of Menu Item called "Search" and a different Category of Menu Item called "Smart Search". Be sure you are in the category called "Smart Search."  (To make it more confusing, the item itself is called "Search" but just be sure you are in the "Smart Search" category.)

After selecting this item type, in the Required Settings, choose your (optional) Search Filter and Save.

This menu item can be placed in a hidden menu if you do not desire a specific search page displayed on the site.  The page doesn't have to exist on its own but it has to be there for the ‘smart search’ to operate properly within a module.

Note that I have not seen this peculiarity on Joomla 3.1 which doesn’t require the menu item to be present.

Tags:
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries