Creating Interaction in Joomla: Using Smart Search

The Joomla Search component enables administrators to do the following:

  • View statistics about what visitors are searching for on a site
  • Customize search settings

The Smart Search is mainly used for customizing search settings. As discussed earlier, Smart Search uses indexed content for searching required information. The entire site is indexed whenever searching is done by the user using this technique. Obviously, the search result is delivered very quickly with this search process. Also, special filters can be added to this search technique to display precise results.

To implement Smart Search, follow these steps:

  1. Enable the Content – Smart Search plug-in.
  2. Index the site.
  3. Unpublish the Search
  4. Enable Smart Search plug-ins.
  5. Apply Search Filters (Optional).
  6. Configure the Smart Search component.
  7. Create a menu item.

1. Enabling the Content – Smart Search Plug-in

The Content – Smart Search plug-in enables site indexing. You get an error if you try to index the site before enabling this plug-in. To enable it, select the Extensions ➤ Plugin Manager option; you see the screen shown in Figure 6-23. From the list of plug-ins, locate Content – Smart Search, which is disabled by default.

If you have difficulty locating Smart Search plug-ins, you can filter out the rest of the plug-ins temporarily by selecting the Finder option from the Select Type filter drop-down list. The finder filter will display only the Smart Search plug-ins. Initially, all the Smart Search plug-ins are disabled. Click its status (red x) check box to enable it. When enabled, the red x status converts into a green check mark (see Figure 6-24).

2. Indexing the Site

After enabling the Smart Search plug-in, the next step is to index the site. To do so, select Component ➤ Smart Search. The Smart Search: Managed Indexed Content page opens up as shown in Figure 6-25.

Before you learn how to index the site, Table 6-1 briefly describes the tools shown in the toolbar at the top of Figure 6-25.

Below the toolbar on the left side are the following three links:

  • Indexed Content: Displays the Manage Indexed Content workspace
  • Content Maps: Displays the Content Maps workspace
  • Search Filters: Displays the Search Filters Manager to apply filters to the search component

By default, the Indexed Content link is selected. Below the three links are two filters that can be applied to the list of indexed items. The first allows you to filter by publication state; the second allows you to filter by type of content.

To index the site, click the Index button on the toolbar. The system begins indexing the site, and you may see the screen shown in Figure 6-26 (top). When indexing is done, you see the window showing the Finish message, as shown in Figure 6-26 (bottom).

Go ahead and close the window; you will see a listing of all the indexed content (see Figure 6-27).

Table 6-2 briefly describes the columns found on the Smart Search: Manage Indexed Content page shown in Figure 6-27.

The Content Maps link on the left side provides another way to view the indexed content. After its link is clicked, the Content Maps workspace opens up, as shown in Figure 6-28. The items in the index are displayed that are grouped on the basis of Author, Category, Country, Language, and so on. The benefit is that you can publish, unpublish, or delete an entire group instead of individual items.

3. Unpublishing the Search Module

Because the Search and Smart Search components are incompatible, only one has to be active at a time to avoid confusion at the front end of the site. So don’t forget to disable the basic keyword Search component before enabling the Smart Search component by opening the Module Manager (click Extensions ➤ Module Manager) and unpublishing the Search module, as shown in Figure 6-29.

4. Enabling Smart Search Plug-ins

Like the basic Search component, Smart Search also includes dedicated plug-ins. Open the Plugin Manager (by clicking Extensions ➤ Plugin Manager) and enable the following listed plug-ins that are associated with Smart Search:

  • Content Smart Search: Enables indexing by the Smart Search This key plug-in is disabled by default. It must be enabled before you use Smart Search.
  • Smart Search – Categories: Enables indexing of categories on your site.
  • Smart Search – Contacts: Enables indexing of Contacts component content.
  • Smart Search – Articles: Enables article indexing on your site.
  • Smart Search – Newsfeeds: Enables indexing of the Newsfeed component content.
  • Smart Search – Weblinks: Enables indexing of the Weblinks component content.

Disable all plug-ins that begin with the word Search –, as shown in Figure 6-30.

5. Applying Search Filters (Optional)

Smart Search can be enhanced by implementing custom search filters. To access the Search Filters feature, click Components ➤ Smart Search option. From the page that opens up, click the Search Filters link. You see the screen shown in Figure 6-31.

To create a new search filter, click the New button on the toolbar. The screen shown in Figure 6-32 will display. Enter a title for your filter in the Title field. Select the options to make the search precise: choosing the required options, search by language, search by type of check boxes, and so on.

Finally, save the filter by clicking the Save & Close button. Your search filter will be created (see Figure 6-33).

Note  The search filter can be used with either the Smart Search module or the Search menu item type.

6. Configuring the Smart Search Component

To suit your or your visitors’ requirements, it is better to configure the Smart Search component. You can access the configuration settings page by either clicking the Options button from the Smart Search page or by clicking the Smart Search link in the Component column of the Global Configuration Manager. The Smart Search: Configuration page appears, as shown in Figure 6-34.

Three tabs are displayed:

  • Search: Shows the options to configure search and its result.
  • Index: Shows the options that configure indexing of your site.
  • Permissions: Shows the options that determine permissions to access the Smart Search component by the users.

The Search tab shows the settings that can be applied to the search form and its results. Following are the options shown by this page:

  • Gather Search Statistics: Select Yes to track search The tracked statistics data is then displayed.
  • Result Description: Select Yes to show the result descriptions in the search.
  • Description Length: Determines the maximum length of the description The default length is 255 characters.
  • Allow Empty Search: Select No if you don’t want the user to submit an empty search query.
  • Result URL: Select Yes if you want to display the URL of the items in the search results.
  • Search Suggestions: Select Yes if you want suggestions to be displayed while the user types in the query.
  • Did You Mean — Select Show option to display the similar text that is entered in the search box: Shows the text to guide the user if no search result appears on the text entered in the search box.
  • Query Explanation: Select the Show option to display the explanation of the query entered in the search box.
  • Advanced Search: Select Yes to display the advanced search option.
  • Advanced Tips: Select No if you don’t want to display the search tips for the advanced search feature.
  • Expand Advanced Search: Select Yes if you want the advanced search panel to appear in an expanded form by default. If set to No, the advanced search initially appears as a button that opens the advanced search panel when clicked.
  • Date Filters: Select Yes to display date filters that display the items that match the specified dates.
  • Sort Field: Select the required sorting criteria for the search Valid options are Relevance, Date, and List price.
  • Sort Direction: Determines whether to arrange search results in ascending or descending order.
  • Highlight Search Terms: Select Yes to highlight the query string in the results set.
  • OpenSearch Name: Used if the browser supports Enter the name that appears in the browser’s search box.
  • OpenSearch Description: Used if the browser supports Enter the description that appears for the search link when it appears in the browser’s search box.

The Index tab shows options for configuring indexing of your site (see Figure 6-35). Indexing consumes system resources, so the options shown on this page enable you to optimize your resources.

Following are the options shown on this page:

  • Indexer Batch Size: Select the desired batch size for Larger batch sizes consume more system resources, but result in faster indexing.
  • Memory Table Limit: The default value of 30000 is designed to work for most systems.
  • Title Text Weight Multiplier: Determines the importance to be given to the title field in the search result. Set its value to 1 if you don’t want to apply additional emphasis on the title of the item. A value less than 1 reduces the emphasis; more than 1 increases the emphasis on the title of the Default value is 1.7.
  • Body Text Weight Multiplier: Determines the importance to be given to the body text of the Default value is 0.7.
  • Meta Data Text Weight Multiplier: Determines the importance to be given to the item’s meta Default value is 1.2.
  • Path Text Weight Multiplier: Determines the importance to be given to the item’s Default value is 2.0.
  • Miscellaneous Text Weight Multiplier: Determines the importance to be given to an item’s other Default value is 0.3.
  • Enable stemmer: Choose the option from the combo box to enable If your site is in English only, you can select the English option. If you have a non- English or multilingual site, you can select Snowball. Valid options are Snowball, English Only, and French Only.
  • Enable Logging: Select Yes to create a log file during indexing that helps to debug any problems that might occur while indexing your site.

7. Creating a Menu Item

The next step is to create a menu item and link it to the Smart Search component. Open the Menu Manager by selecting Menus ➤ Menu Manager. You’ll see a list of all the existing menus.

You can either edit the existing Searching menu item that you created and modify it to be used for Smart Search module, or you can trash the Searching menu item and create a new Smart Searching component. You will use the latter approach.

Click the New icon to create a new menu item. You’ll see a screen that lets you enter the information for that item. Enter the information shown in Figure 6-36.

The title you want to appear for the menu item is Smart Searching, so enter it in the Menu Title field. In the Search Query field, you can enter the text that you want to be immediately searched when a user selects the menu item. For example, if you enter electronics in this field, you will get the search results for the text electronics whenever this menu item is selected. From Search Filter, you can apply the search filters, if any. Let’s select the Precise Search filter that you already created.

Clicking the Select button from the Menu Item Type field displays a screen for selecting the menu item type (see Figure 6-37). Obviously, you will select the Smart Search ➤ Search menu item type. Recall that this menu item not only displays the search box but also the Advanced Search button that displays the text that guides you get the precise result. Also, it displays the filters that enable users to search in required content type only.

After entering the information for the menu item Smart Searching, click the Save & Close icon to save it. You’ll see the Smart Searching title appear in the list of menu items in the Main Menu, as shown in Figure 6-38.

When you refresh the front end of the web site, you will find the Smart Searching menu item in the main menu of the site, as shown in Figure 6-39. When the Smart Searching menu item is clicked, the search form appears that can be used for searching desired content in the site. While typing in the search box, suggestions will appear to select from.

When you click the Advanced Search button, you will see additional text displayed on the site that guides you to get precise search results. Also, you get filters displayed that you can use to apply the search to limited content of the site (see Figure 6-40).

Source: Harwani B M (2015), Foundations of Joomla!, Apress; 2nd ed edition

Leave a Reply

Your email address will not be published. Required fields are marked *