diff options
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r-- | inc/fulltext.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index 59a9c1d96..be3938cac 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -396,6 +396,11 @@ function ft_snippet($id,$highlight){ * Wraps a search term in regex boundary checks. */ function ft_snippet_re_preprocess($term) { + // do not process asian terms where word boundaries are not explicit + if(preg_match('/'.IDX_ASIAN.'/u',$term)){ + return $term; + } + if(substr($term,0,2) == '\\*'){ $term = substr($term,2); }else{ @@ -734,7 +739,7 @@ function ft_termParser($term, &$stopwords, $consider_asian = true, $phrase_mode // successive asian characters need to be searched as a phrase $words = preg_split('/('.IDX_ASIAN.'+)/u', $term, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); foreach ($words as $word) { - if (preg_match('/'.IDX_ASIAN.'/u', $word)) $phrase_mode = true; + $phrase_mode = $phrase_mode ? true : preg_match('/'.IDX_ASIAN.'/u', $word); $parsed .= ft_termParser($word, $stopwords, false, $phrase_mode); } } else { |