Skip to content
Browse files

#1 Script to index all pages

  • Loading branch information...
1 parent 644b072 commit ef2f43046aad281e7dd51fd83b67d5fce4c4abe3 @neolao committed
Showing with 14 additions and 0 deletions.
  1. +3 −0 .wiki/admin/index.php
  2. +11 −0 .wiki/admin/search/indexAllPages.php
View
3 .wiki/admin/index.php
@@ -14,5 +14,8 @@
<h2>Search engine</h2>
<p>Document count : <?php echo $search->getDocumentCount(); ?></p>
+ <ul>
+ <li><a href="search/indexAllPages.php">Index all pages</a></li>
+ </ul>
</body>
</html>
View
11 .wiki/admin/search/indexAllPages.php
@@ -0,0 +1,11 @@
+<?php
+include(dirname(__FILE__).'/../../inc/common.php');
+
+$filePaths = rglob('*.wiki', BASE_PATH);
+
+$search = new Wiki_Search();
+foreach ($filePaths as $filePath) {
+ $search->index($filePath);
+}
+
+header('Location: ..');

0 comments on commit ef2f430

Please sign in to comment.
Something went wrong with that request. Please try again.