ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search Results are Case Sensitive? Looking for help troubleshooting

April 27, 2011 1:48pm

Subscribe [2]
  • #1 / Apr 27, 2011 1:48pm

    erier

    55 posts

    Hello.

    I’ve set up a simple search results page, and different results come up depending on case sensitivity.

    For Example, if the word “Umbrella” is searched, the correct data is presented.

    If the word “umbrella” is searched, the correct data is not presented.

    Additionally, this data is being pulled from Matrix, and the word “Umbrella” is entered into the Matrix with the capital “U”. Why are only exact matches (case sensitive)?

    Thanks for your help in advance ...

  • #2 / Apr 27, 2011 2:32pm

    erier

    55 posts

    I think I found the solution. I’m not a PHP expert, but this plugin is simple to use and worked for me:

    phpStringFun

    So, in my search results page, I now have this code:

    {exp:search:search_results}
    You searched for 
    <strong>
          {exp:phpstringfun function="ucwords"}{exp:search:keywords}{/exp:phpstringfun}
    </strong>
    

    The PHP “ucwords” function changes each first letter of each word in the string to uppercase. So, if the user typed in “search term”, the parsed result would be: “Search Term”.

    Hope this helps someone.

  • #3 / Apr 28, 2011 5:27am

    John Henry Donovan

    12339 posts

    Fat Free Interactive,

    Glad you found a solution.
    Did you test it outside of the Matrix? Maybe just a simple native textarea

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases