mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-22 13:45:02 +00:00
feature-search: remove debugging
This commit is contained in:
parent
31253edff4
commit
36e8fe2a17
2 changed files with 2 additions and 9 deletions
|
@ -152,7 +152,6 @@ register_module([
|
|||
$start = microtime(true);
|
||||
// FUTURE: When we implement $_GET["offset"] and $_GET["count"] or something we can optimise here
|
||||
foreach($results as $key => &$result) {
|
||||
error_log("[search/context extractor] pagename: {$result["pagename"]}");
|
||||
$filepath = $env->storage_prefix . $result["pagename"] . ".md";
|
||||
if(!file_exists($filepath)) {
|
||||
error_log("[pepperminty wiki/$settings->sitename/search] Search engine returned {$result["pagename"]} as a result (maps to $filepath), but it doesn't exist on disk (try rebuilding the search index).");
|
||||
|
@ -172,15 +171,11 @@ register_module([
|
|||
$env->perfdata->search_time = round((microtime(true) - $search_start)*1000, 3);
|
||||
header("x-search-time: {$env->perfdata->search_time}ms");
|
||||
|
||||
error_log(var_export($results, true));
|
||||
|
||||
if(!empty($_GET["format"]) && $_GET["format"] == "json") {
|
||||
header("content-type: application/json");
|
||||
$json_results = new stdClass();
|
||||
foreach($results as $key => $result) {
|
||||
error_log("[search/json] id: $key, pagename: {$result["pagename"]}");
|
||||
foreach($results as $key => $result)
|
||||
$json_results->{$result["pagename"]} = $result;
|
||||
}
|
||||
exit(json_encode($json_results));
|
||||
}
|
||||
|
||||
|
@ -238,12 +233,9 @@ register_module([
|
|||
}
|
||||
}
|
||||
|
||||
var_dump($results);
|
||||
|
||||
$i = 0; // todo use $_GET["offset"] and $_GET["result-count"] or something
|
||||
foreach($results as $result)
|
||||
{
|
||||
error_log("[search] pagename: {$result["pagename"]}");
|
||||
$link = "?page=" . rawurlencode($result["pagename"]);
|
||||
$pagesource = file_get_contents($env->storage_prefix . $result["pagename"] . ".md");
|
||||
|
||||
|
|
|
@ -913,6 +913,7 @@ class search
|
|||
|
||||
// TODO: Remove items if the computed rank is below a threshold
|
||||
}
|
||||
unset($pagedata); // Ref https://bugs.php.net/bug.php?id=70387
|
||||
|
||||
uasort($matching_pages, function($a, $b) {
|
||||
if($a["rank"] == $b["rank"]) return 0;
|
||||
|
|
Loading…
Reference in a new issue