WordPress.org

Forums

Relevanssi - A Better Search
[resolved] Special searchs (3 posts)

  1. AliMH
    Member
    Posted 2 years ago #

    Hi mate, first need to thanks for your awesome plugins.
    i faced an special searches like: k-on
    i have a post with k-on title.
    http://www.animup.net/anime/k-on/
    when i search for it, it cannot find it but when i use wordpress default search engine in admin page has no problem.
    what can i do for these search terms?

    my site:
    http://www.animup.net/?s=k-on&post_types=animes

    another site (not mine):
    http://myanimelist.net/anime.php?q=k-on

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 2 years ago #

    By default, Relevanssi replaces the hyphen in your search term with a space, leaving you with "k on", which probably doesn't find anything.

    Try adding this to your theme functions.php, indexing the database again and then searching:

    add_filter('relevanssi_remove_punctuation', 'fixhyphens1', 9);
    function fixhyphens1($a) {
       $a = str_replace('-', 'HYPHENHYPHEN', $a);
       return $a;
    }
    
    add_filter('relevanssi_remove_punctuation', 'fixhyphens2', 11);
    function fixhyphens2($a) {
       $a = str_replace('HYPHENHYPHEN', '-', $a);
       return $a;
    }
  3. AliMH
    Member
    Posted 2 years ago #

    thank you, workin like charm

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.