Created
November 16, 2019 11:21
-
-
Save jreviews/cbd64b703c12093d41240ad344afb242 to your computer and use it in GitHub Desktop.
JReviews Developer Filter: Change the minimum word length requirement for searches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('MVC_FRAMEWORK') or die; | |
/** | |
* Change the minimum word length requirement for a word to be included in a keyword search | |
*/ | |
function listing_search_minimum_characters($request, $params) | |
{ | |
ListingsRepositoryComponent::$min_word_chars = 2; | |
return $request; | |
} | |
Clickfwd\Hook\Filter::add('before_filter_request_categories_search', 'listing_search_minimum_characters', 10); | |
Clickfwd\Hook\Filter::add('before_filter_request_categories_liveSearch', 'listing_search_minimum_characters', 10); | |
Clickfwd\Hook\Filter::add('before_filter_request_categories_liveFilter', 'listing_search_minimum_characters', 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this filter:
require_once "listing_search_minimum_characters.php";