• Resolved wagahaifujoshi

    (@wagahaifujoshi)


    Hi,

    I’d like to enable one letter/number word search. I set the minimum word length to index to 1, but the one letter search didn’t work even though I see one letter words in my index. So I searched on your site and I found out that relevanssi_block_one_letter_searches should be my answer and it should look something like this :

    add_filter('relevanssi_block_one_letter_searches', 'something');
    function something {
        return false;
    }

    Problem is I have a very basic understanding of code and so I’m not sure where to put it/how to write it correctly, I’m guessing it should go in relevanssi’s search.php ?

    Thank you, your plugin is wonderful!

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

    (@msaari)

    No, never touch the Relevanssi files, as all the changes will be overwritten by the next Relevanssi update. Your theme functions.php is a good place, but if your theme also has updates, child theme is the best place.

    Also, do note that in most cases a single letter search will return most of the posts in the database, so it’s often not very helpful. If you really have a use for one-letter searches, make sure fuzzy searching is always disabled.

    Thread Starter wagahaifujoshi

    (@wagahaifujoshi)

    Yes, fuzzy search is deactivated. I need single letter search for single digit chapter numbers.
    Thank you very much for the fast answer!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Enabling one letter searches’ is closed to new replies.