diff options
author | Michael Hamann <michael@content-space.de> | 2011-01-23 20:33:32 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2011-01-23 20:33:32 +0100 |
commit | fc756e0d4d88b37c01a9155e675a549430b00593 (patch) | |
tree | 7adc185d2c349788961ff7cb8f9bcb25afbce485 /inc/fulltext.php | |
parent | 8605afb1b4e2a6a9e11e21a7bf0775bbb0d5af03 (diff) | |
parent | 820923f1328bcfe6002831570eb65238411c5b70 (diff) | |
download | rpg-fc756e0d4d88b37c01a9155e675a549430b00593.tar.gz rpg-fc756e0d4d88b37c01a9155e675a549430b00593.tar.bz2 |
Merge branch 'master' into indexer_improvements
Conflicts:
inc/fulltext.php
inc/indexer.php
lib/exe/indexer.php
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r-- | inc/fulltext.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index 35ee4ba34..805da2e37 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -376,6 +376,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{ @@ -710,7 +715,7 @@ function ft_termParser($Indexer, $term, $consider_asian = true, $phrase_mode = f // 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($Indexer, $word, false, $phrase_mode); } } else { @@ -732,4 +737,4 @@ function ft_termParser($Indexer, $term, $consider_asian = true, $phrase_mode = f return $parsed; } -//Setup VIM: ex: et ts=4 enc=utf-8 : +//Setup VIM: ex: et ts=4 : |