2

How can I set Smart Search to search as exact phrase by default? I've noticed that most of our users expect "exact phrase" behaviour rather than "this AND that" behaviour when they type into the Smart Search module, and are disappointed by the results.

For example, when a user types the following into the search box:

freedom of speech

what they actually mean (but never actually type) is:

"freedom of speech"

They are then disappointed by results that contain the words "freedom", "of" and "speech" individually. I would like to set Smart Search to "exact phrase" behaviour by default.

Does anyone have ideas on how to do this?

1 Answer 1

3

Are you using an associated menu item for the Search Results? If so, you should be able to go on the OPTIONS tab and change the "Search For" to "Exact Phrase." If using the module, make sure you set the "Set ItemID" to that menu item.

7
  • Thanks for your reply, YellowWebMonkey. I either don't have this "Search for" option or I don't know where to find it. I have gone to Components > Smart Search, then clicked the "Options" button. The configuration options that appear do not include "Search for". Here's a screenshot — would you mind having a look and confirming if I'm in the right spot? Many thanks.
    – mank
    Jun 9, 2016 at 4:28
  • It is within the menu item. If you do not have one, you need to make one: goo.gl/fRUQXU. Within that, you change the SEARCH FOR: goo.gl/78WJi8. You probably want to make a new menu to put this on since you do not want it to show on your main navigation. My general practice is to make a menu named "System" with links like search, login, sitemap, etc. Jun 9, 2016 at 14:11
  • Thanks for the screenshots, YellowWebMonkey. I see now that your menu item is of type "Seach > Search form or search results" (mine is "Smart Search > Search"). I think perhaps you're using default Search, not Smart Search (which is not enabled by default in Joomla 2.5). It would appear that default search is com_search and Smart Search is com_finder. At any rate, I tried out "Search form or search results" with exact phrase, and it was returning pages that didn't contain the search phrase at all. I might just have to give up :(
    – mank
    Jun 14, 2016 at 6:28
  • If you are willing to use something besides Smart Search, I have done something similar in MijoSearch by hacking administrator/components/com_mijosearch/library/search.php and modifying the types of searches in function getSearchQuery() Jun 14, 2016 at 14:13
  • Thanks for MijoSearch rec. How would you rate its "exact phrase" function? I had a look at the demo site, and searching for the exact phrase "It is a great way" produces no results even though the phrase occurs in the page MijoSEF - Joomla SEO & SEF, which surprised me.
    – mank
    Jun 16, 2016 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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