2

I want smart search to go directly to page when the query have ONE result.

I have a list of contacts, all assigned a number of area codes.

What I've done so far is:
- Enabled smart search
- added smart search module
- added area codes as tags in each contact
- Indexed content
- made a search filter only searching tags

I want the user to be able to search for the nearest contact by inserting their area code in the search box. When doing this I want the contact information to come right up on the page.

However, when searching the tag appears as a link, when clicking, then the contact name as a link, when clicking, then the contact information.

I want to skip the two first steps.

Does anyone have a suggestion on how to do that, or know of any extension to solve this?

2

The SmartSearch component doesn't support showing a page directly. But I think it should be easy to do in a layout override for the results page. The overrides can be created in the template manager (see Help Page: http://docs.joomla.org/J3.3:How_to_use_the_Template_Manager#Creating_Overrides) You need to create the override for com_finder.

You could then check in this override if the results array $this->results contains only one element and redirect to the URL instead of showing the results page.

The second step could be changed using a custom smart search plugin. You can copy the existing one, rename it and adjust it so it indexes the desired URL. For more information about how to create a finder plugin, see this doc page: http://docs.joomla.org/Creating_a_Smart_Search_plug-in

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.