All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Apostrophe question (can we manipulate a search string)?

Christiaan Knol 24 Sep 2014 05:20 question, complete

We are developing a site dealing with Parkinson's Disease.

Correctly, the site references "Parkinson’s", however, search terms (users) would probably search for "parkinsons" which returns no results.

I understand the search index includes "Parkinson s" - replacing the apostrophe with a space, hence "Parkinsons" isn't being found. Search works fine if a user enters either an apostrophe or curly quote.

Is it possible to manipulate the search string, so if a user search query contains "Parkinsons" it can either be manipulated to "Parkinson" or "Parkinon's" automatically to return correct results?

Basically a search/replace for the search term / query string?

Regards,

Christiaan

Replies

  1. Low 24 Sep 2014 10:32

    You could create an extension using the low_search_pre_search hook, and replace instances of "parkinsons" to "parkinson's" which should then trigger the correct results.