Relevanssi – A Better Search - Version 3.5.11.1

Version Description

  • New filter: relevanssi_allow_one_letter_highlights lets you allow one-letter highlights. Just make the filter function return true.
  • New filter: relevanssi_block_one_letter_searches by default blocks one-letter searches. If you want to enable them, add a filter function that always returns false.
  • Fixed an undefined variable notice.
Download this release

Release Info

Developer msaari
Plugin Icon 128x128 Relevanssi – A Better Search
Version 3.5.11.1
Comparing to
See all releases

Code changes from version 3.5.11 to 3.5.11.1

Files changed (4) hide show
  1. lib/excerpts-highlights.php +5 -1
  2. lib/search.php +1 -0
  3. readme.txt +9 -1
  4. relevanssi.php +1 -1
lib/excerpts-highlights.php CHANGED
@@ -266,8 +266,12 @@ function relevanssi_highlight_terms($excerpt, $query, $in_docs = false) {
266
  mb_internal_encoding("UTF-8");
267
 
268
  do_action('relevanssi_highlight_tokenize');
269
- $terms = array_keys(relevanssi_tokenize($query, $remove_stopwords = true, $min_word_length = 2));
270
  // Setting min_word_length to 2, in order to avoid 1-letter highlights.
 
 
 
 
271
 
272
  if (is_array($query)) $query = implode(' ', $query); // just in case
273
  $phrases = relevanssi_extract_phrases(stripslashes($query));
266
  mb_internal_encoding("UTF-8");
267
 
268
  do_action('relevanssi_highlight_tokenize');
269
+
270
  // Setting min_word_length to 2, in order to avoid 1-letter highlights.
271
+ $min_word_length = 2;
272
+ if (apply_filters('relevanssi_allow_one_letter_highlights', false)) $min_word_length = 1;
273
+
274
+ $terms = array_keys(relevanssi_tokenize($query, $remove_stopwords = true, $min_word_length));
275
 
276
  if (is_array($query)) $query = implode(' ', $query); // just in case
277
  $phrases = relevanssi_extract_phrases(stripslashes($query));
lib/search.php CHANGED
@@ -379,6 +379,7 @@ function relevanssi_search($args) {
379
  !$post_type ? $negative_post_type = relevanssi_get_negative_post_type() : $negative_post_type = NULL;
380
 
381
  $non_post_post_types_array = array();
 
382
  if (function_exists('relevanssi_get_non_post_post_types')) {
383
  $non_post_post_types_array = relevanssi_get_non_post_post_types();
384
  }
379
  !$post_type ? $negative_post_type = relevanssi_get_negative_post_type() : $negative_post_type = NULL;
380
 
381
  $non_post_post_types_array = array();
382
+ $non_post_post_type = NULL;
383
  if (function_exists('relevanssi_get_non_post_post_types')) {
384
  $non_post_post_types_array = relevanssi_get_non_post_post_types();
385
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.relevanssi.com/buy-premium/
4
  Tags: search, relevance, better search
5
  Requires at least: 4.0
6
  Tested up to: 4.9
7
- Stable tag: 3.5.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -268,6 +268,11 @@ Each document database is full of useless words. All the little words that appea
268
 
269
  == Changelog ==
270
 
 
 
 
 
 
271
  = 3.5.11 =
272
  * Synonym indexing failed if synonyms contained a forward slash.
273
  * Highlighting HTML tags has been improved further.
@@ -1058,6 +1063,9 @@ Each document database is full of useless words. All the little words that appea
1058
 
1059
  == Upgrade notice ==
1060
 
 
 
 
1061
  = 3.5.11 =
1062
  * Improvements in excerpts, new filters.
1063
 
4
  Tags: search, relevance, better search
5
  Requires at least: 4.0
6
  Tested up to: 4.9
7
+ Stable tag: 3.5.11.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
268
 
269
  == Changelog ==
270
 
271
+ = 3.5.11.1 =
272
+ * New filter: `relevanssi_allow_one_letter_highlights` lets you allow one-letter highlights. Just make the filter function return `true`.
273
+ * New filter: `relevanssi_block_one_letter_searches` by default blocks one-letter searches. If you want to enable them, add a filter function that always returns `false`.
274
+ * Fixed an undefined variable notice.
275
+
276
  = 3.5.11 =
277
  * Synonym indexing failed if synonyms contained a forward slash.
278
  * Highlighting HTML tags has been improved further.
1063
 
1064
  == Upgrade notice ==
1065
 
1066
+ = 3.5.11.1 =
1067
+ * Minor bug fix, kills an error notice.
1068
+
1069
  = 3.5.11 =
1070
  * Improvements in excerpts, new filters.
1071
 
relevanssi.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Relevanssi
4
  Plugin URI: http://www.relevanssi.com/
5
  Description: This plugin replaces WordPress search with a relevance-sorting search.
6
- Version: 3.5.11
7
  Author: Mikko Saari
8
  Author URI: http://www.mikkosaari.fi/
9
  */
3
  Plugin Name: Relevanssi
4
  Plugin URI: http://www.relevanssi.com/
5
  Description: This plugin replaces WordPress search with a relevance-sorting search.
6
+ Version: 3.5.11.1
7
  Author: Mikko Saari
8
  Author URI: http://www.mikkosaari.fi/
9
  */