summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/fulltext.php9
-rw-r--r--inc/indexer.php2
2 files changed, 6 insertions, 5 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php
index 3940bc0c4..22e28845c 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -97,14 +97,15 @@ function ft_backlinks($id){
// quick lookup of the pagename
$page = noNS($id);
- $matches = idx_lookup(array($page));
+ $sw = array(); // we don't use stopwords here
+ $matches = idx_lookup(idx_tokenizer($page,$sw)); //pagename may contain specials (_ or .)
+ $docs = ft_resultCombine(array_values($matches));
- if(!count($matches)) return $result;
+ if(!count($docs)) return $result;
require_once(DOKU_INC.'inc/parserutils.php');
-
// check instructions for matching links
- foreach(array_keys($matches[$page]) as $match){
+ foreach(array_keys($docs) as $match){
$instructions = p_cached_instructions(wikiFN($match),true);
if(is_null($instructions)) continue;
diff --git a/inc/indexer.php b/inc/indexer.php
index fe8e74bd9..6ece84d7b 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -316,7 +316,7 @@ function idx_tokenizer($string,&$stopwords){
foreach ($arr as $w) {
if (!is_numeric($w) && strlen($w) < 3) continue;
$w = utf8_strtolower($w);
- if(is_int(array_search("$w\n",$stopwords))) continue;
+ if($stopwords && is_int(array_search("$w\n",$stopwords))) continue;
$words[] = $w;
}
}else{