From f078bb0088870b4b68b348d546afa30a80a07e87 Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Mon, 24 Jan 2011 03:46:11 -0500 Subject: Indexer Rewrite v3: wildcards in lookupKey and automatically unwrap single result --- inc/fulltext.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'inc/fulltext.php') diff --git a/inc/fulltext.php b/inc/fulltext.php index 35ee4ba34..f477e826e 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -130,7 +130,6 @@ function ft_backlinks($id){ $result = array(); $result = idx_get_indexer()->lookupKey('relation_references', $id); - $result = $result[$id]; if(!count($result)) return $result; @@ -234,8 +233,12 @@ function _ft_pageLookup(&$data){ $pages[$p_id] = p_get_first_heading($p_id, false); } } - //if ($in_title) - // $titles = $Indexer->lookupKey('title', "*$id*"); + if ($in_title) { + foreach ($Indexer->lookupKey('title', "*$id*") as $p_id) { + if (!isset($pages[$p_id])) + $pages[$p_id] = p_get_first_heading($p_id, false); + } + } } if (isset($ns)) { foreach ($page_idx as $p_id) { -- cgit v1.2.3