• Home
  • History
  • Annotate
Name Date Size #Lines LOC




AddDocument.phpH A D02-Jul-20121.3 KiB6141

ConnectionException.phpH A D02-Jul-2012251 122

Pageinfo.phpH A D02-Jul-20121.2 KiB5136

README.mdH A D02-Jul-20123.8 KiB5837

action.phpH A D02-Jul-201213.4 KiB433299

helper.phpH A D02-Jul-201211.6 KiB349285

index_all.phpH A D02-Jul-20124 KiB144107

schema.xmlH A D02-Jul-201212.6 KiB241145

script.jsH A D02-Jul-20121.4 KiB4429

style.cssH A D02-Jul-2012331 1814


1Solr Search Plugin
4This DokuWiki plugin enables you to index and search your wiki pages in a Solr  server installation.
8Installation has three stages - basic installation, Solr configuration and integration with your DokuWiki template.
10For **basic installation** put the folder containing this README in the `lib/plugins` folder of your DokuWiki installation.
11**IMPORTANT:** If you downloaded the plugin from GitHub, make sure that that folder is named `solr`! Otherwise the plugin won't be found.
13For **Solr configuration** install and configure a Solr server with the instructions from the Solr Wiki (http://wiki.apache.org/solr/FrontPage ). For testing purposes you can use the example environment in the `example` folder of the Solr distribution. On the command line, change to the example folder and type
15    java -jar start.jar
17The `schema.xml` file that comes with this plugin can be used as your starting  point for creating a Solr search schema. Consider adding stop words to the stop word list. Also consider using language-specific stemmers and domain-specific synonyms.
19If your Solr server is not located at the URL http://localhost:8983/solr you have to open the DokuWiki configuration page and set the Solr URL in the input field for the Solr plugin.
21The last step of the installation is the **integration with your DokuWiki template**, i.e. replacing the standard wiki search field with the Solr search field. Open the `main.php` file of you template and look for the code
23     <?php tpl_searchform(); ?>
25Replace it with the following code:
27    <?php
28      $solr =& plugin_load("helper", "solr");
29      $solr->tpl_searchform(true, false); // Search field with ajax and no autocomplete
30    ?>
32This will create a search form where the search terms are searched in the content of the document. Search terms that occur in the first headline (the page title) or the first paragraph (the page abstract) will give the result document a higher ranking. Wildcards are automatically added at the end of each search term.
34### Advanced Search ###
35The plugin provides a form for advanced search where users can search for exact phrases, exclude words, search inside page titles, abstracts and namespaces and search for specific authors. To create a button to the advanced search form, place the following code at the appropriate place in your `main.php`:
37    <?php
38      $solr =& plugin_load("helper", "solr");
39      $solr->htmlAdvancedSearchBtn();
40     ?>
42Indexing your wiki
45### Indexing all pages ###
46You can call the command line script `index_all.php` that comes with this plugin to index all of your wiki pages. The speed of this script greatly depends on your server speed, so you should not have an execution time limiit for PHP scripts started on the command line.
48### Indexing individual pages ###
49Each page is also indexed when it is visited by a user. See the next section on how the indexing mechanism works.
51### The indexing mechanism ###
52After installing the plugin it will index every page using the DokuWiki indexing mechanism: An invisible graphic that calls the file `lib/exe/indexer.php`. `indexer.php` issues an event which is handled by the Solr plugin if the page was modified since it was last indexed. After the plugin has indexed a page, it creates a file with the suffix `.solr_indexed` in the page's meta directory. If the modification date of this file is greater than the page modification date, the plugin does nothing and the other indexing actions specified in `indexer.php` are taken.
54Planned Improvements
56Searching by date: At the moment the creation and modification date is indexed but there is no way to search for it. This is because DokuWiki has no API for creating localized date entry fields and I don't want to create such a field myself.