mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 05:22:59 +00:00
search: squash file_get_contents warning, but more insight is needed. closes #193.
This commit is contained in:
parent
b4e4094451
commit
86216fd4c1
2 changed files with 7 additions and 1 deletions
|
@ -43,6 +43,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
|
||||||
- Squashed the text `\A` appearing before tags at the bottom of pages for some users ([ref](https://gitter.im/Pepperminty-Wiki/Lobby?at=5f0632068342f4627401f145))
|
- Squashed the text `\A` appearing before tags at the bottom of pages for some users ([ref](https://gitter.im/Pepperminty-Wiki/Lobby?at=5f0632068342f4627401f145))
|
||||||
- Fixed an issue causing uploaded avatars not to render
|
- Fixed an issue causing uploaded avatars not to render
|
||||||
- Fixed an obscure bug in the search engine when excluding terms that appear both in a page's title and body
|
- Fixed an obscure bug in the search engine when excluding terms that appear both in a page's title and body
|
||||||
|
- Squashed a warning at the top of search results (more insight is needed though to squash the inconsistencies in the search index that creep in though)
|
||||||
|
|
||||||
|
|
||||||
## v0.21.1-hotfix1
|
## v0.21.1-hotfix1
|
||||||
|
|
|
@ -151,10 +151,15 @@ register_module([
|
||||||
|
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
foreach($results as &$result) {
|
foreach($results as &$result) {
|
||||||
|
$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).");
|
||||||
|
continue; // Something strange is happening
|
||||||
|
}
|
||||||
$result["context"] = search::extract_context(
|
$result["context"] = search::extract_context(
|
||||||
$result["pagename"],
|
$result["pagename"],
|
||||||
$query_parsed,
|
$query_parsed,
|
||||||
file_get_contents($env->storage_prefix . $result["pagename"] . ".md")
|
file_get_contents()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$env->perfdata->context_generation_time = round((microtime(true) - $start)*1000, 3);
|
$env->perfdata->context_generation_time = round((microtime(true) - $start)*1000, 3);
|
||||||
|
|
Loading…
Reference in a new issue