I am working on finishing up a new project here at work that uses Mura CMS. We wanted the site to have some search capabilities but honestly didn't want to spend anytime building our own or integrating a custom search engine.
We started looking at Mura to see if there were any built in capabilities and sure enough there was. If you look under {siteid}/includes/display_objects you will find dsp_search_form.cfm and dsp_search_results.cfm. We wanted to include the search form in our header, lucky for us that is pretty easy to do. If you open up your header template you can drop the following code in to include the search form.
Now I had a form that my users could enter a search term in and hit go. The default is to redirect the user to the page that they are on and display the results. This really doesn't look good to me so what we ended up doing is creating a page in the site manager that does not show up in the navigation. So I have a page for my search results, and now I just needed to mod my search form so it posts to that page and itself. In {siteid}/includes/display_objects/dsp_search_form.cfm modify the action so it looks something like this.
With everything in place we started testing the search functionality and it just was not bringing back the result we were expecting. I realized we were using Oracle and that any text comparisons we were doing are going to be Case Sensitive. This means if we were looking for Study Guide in the database and the user typed study guide in the form we were not going to find a match. I started digging around and I found the method that does the search. If you look in /requirements/mura/content/contentGateway.cfc you will find a method named getPublicSearch.
The easy fix for this is to do comparison of the search term and the text in the database in the same case. So I went through and updated the where clause to look something like this. Now when I tested the search everything was working as expected. Here is the entire search method in case you don't feel like updating it yourself. I attached the code as an enclosure because of the amount of code.
