This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Enable and disable exact match on frontend?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Enable and disable exact match on frontend?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11026
    expromoexpromo
    Participant

    Hello,

    I would like to know if it is possible to give frontend users the choice whether they prefer to search with full word exact match or without it (substring search). It would be a really important for my users to have this ability.

    Best regards
    Patryk

    #11032
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Patryk,

    On the Frontend Search Settings -> General panel you can enable the “Show exact matches only” option: http://i.imgur.com/6zMBR46.png
    Exact matching is still a substring matching, however the string must match as it is, including the ordering.

    Exact matching with word boundaries is not possible without using regular expressions (using the RLIKE operator) in mySQL, which is extremely inefficient and resource heavy, it’s not implemented for safety reasons.

    #11035
    expromoexpromo
    Participant

    Thanks for this response, but we did not mean the exact vs. fuzzy matching, but full word vs. partial word match: the choice corresponding to your Behaviour setting AND versus AND WITH EXACT WORD MATCH.

    #11038
    Ernest MarcinkoErnest Marcinko
    Keymaster

    That is unfortunately not possible yet, planned feature for the upcoming release.

    However you could try the following custom code to re-purpose the exact matches option:

    This will basically detect if the “Show exact matches” option in selected, and if yes then changes the keyword logic to “and with exact keyword matches” instead of the default behavior.

    #11076
    expromoexpromo
    Participant

    Nice.
    This code changes the search behaviour just as I wanted.

    Thank you 🙂

    #11077
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You are very welcome!

    If you don’t mind, I will close this topic and mark it as resolved for now, feel free to open another one if you have other questions/issues.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Enable and disable exact match on frontend?’ is closed to new replies.