• Resolved specotech

    (@specotech)


    My company has products that are titled O2iD8, O6MDP3 etc and visitors to our site seem to confuse the letter O at the front of these part numbers with the number 0 leading to no results when using our search bar. I tried using o=0 in the synonyms section to no avail. How can the number 0 equal o in their searches if someone were to type in (for example) 02iD8 instead of O2iD8 and yield the O2iD8 product? Thanks!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    I’d do it like this:

    add_filter( 'relevanssi_post_title_before_tokenize', 'rlv_o_to_0' );
    function rlv_o_to_0( $title ) {
      return $title . ' ' . str_replace( 'O', '0', $title );
    }

    Add this to your theme functions.php and rebuild the index. Now the titles will be indexed both ways, so the O2iD8 will be indexed as O2iD8 02iD8.

    Thread Starter specotech

    (@specotech)

    Great that worked. Thank you Mikko!

    Plugin Author Mikko Saari

    (@msaari)

    Good to hear! If you appreciate the support you received, please consider leaving a review for the plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can you make the number “0” equal the letter “o” when site visitors search?’ is closed to new replies.