<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>HelpOnXapian</title></articleinfo><para>Using Xapian you can dramatically improve the performance of searching in moin and furthermore unlock some more features (see the search prefixes above) not possible with the legacy search engine. </para><itemizedlist><listitem override="none"><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/idea.png" width="16"/></imageobject><textobject><phrase>(!)</phrase></textobject></inlinemediaobject> New in release 1.6 </para></listitem></itemizedlist><section><title>Setting it up</title><section><title>Requirements</title><para>You must have Xapian itself and its Python bindings (xapian-core and xapian-bindings) from <ulink url="http://www.xapian.org/"/> at least in version 0.9.6 installed. </para><para>It is also recommended to install <ulink url="http://snowball.tartarus.org/download.php">PyStemmer</ulink> to be able to search for stemmed words. Please note that you need to have PyStemmer installed <emphasis role="strong">before</emphasis> building the index if you want to use this feature! You can always rebuild the index after installing it at any later time, though. </para></section><section><title>Configuration</title><para>In your wikiconfig, you have several options on how to configure Xapian: </para><itemizedlist><listitem><para><emphasis role="strong">xapian_search</emphasis> (default: False) </para><itemizedlist><listitem override="none"><para>Setting this to True, enables Xapian search for your <ulink url="http://www.nnx.me/HelpOnXapian/MoinMoin#">MoinMoin</ulink> wiki. </para><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/idea.png" width="16"/></imageobject><textobject><phrase>(!)</phrase></textobject></inlinemediaobject> Moin will auto disable xapian_search (and fall back to slow search) if it doesn't find a usable index. You can see whether it uses Xapian on <ulink url="http://www.nnx.me/HelpOnXapian/SystemInfo#">SystemInfo</ulink>. </para></listitem></itemizedlist></listitem><listitem><para><emphasis role="strong">xapian_index_history</emphasis> (default: False) </para><itemizedlist><listitem override="none"><para>If this option is enabled, all revisions of all pages (except underlay, of which only one revision is available) are indexed. This allows users to search in older revisions of pages if enabled in the search dialogue on <ulink url="http://www.nnx.me/HelpOnXapian/FindPage#">FindPage</ulink>. <inlinemediaobject><imageobject><imagedata depth="15" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/alert.png" width="15"/></imageobject><textobject><phrase>/!\</phrase></textobject></inlinemediaobject> You need to rebuild your index if you change this option. Also check the size of your index after build if you're running a big wiki as this feature can eat up a lot of disk space. Creating the index might take rather long, if indexing history is enabled. </para></listitem></itemizedlist></listitem><listitem><para><emphasis role="strong">xapian_index_dir</emphasis> (default: None) </para><itemizedlist><listitem override="none"><para>This option lets you specifiy a separate directory to save your index to. Initially, it gets saved to <emphasis>data_dir</emphasis>/cache/xapian/. Furthermore, if this option is used, every wiki on a wikifarm gets its own index identified by it's wikiname as opposed to a single index in standard configuration. Set this option if running a wikifarm! <inlinemediaobject><imageobject><imagedata depth="15" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/alert.png" width="15"/></imageobject><textobject><phrase>/!\</phrase></textobject></inlinemediaobject> Don't forget to (re-)build an/the index/indices after enabling this! </para></listitem></itemizedlist></listitem><listitem><para><emphasis role="strong">xapian_stemming</emphasis> (default: True) </para><itemizedlist><listitem override="none"><para>If enabled and <ulink url="http://www.nnx.me/HelpOnXapian/PyStemmer#">PyStemmer</ulink> being available (see above), words will be indexed in their raw and stemmed forms and terms in your search query are stemmed in your language. This means that searching for &quot;testing&quot; will also yield pages containing the words &quot;tested&quot;, &quot;tester&quot; etc. <inlinemediaobject><imageobject><imagedata depth="15" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/alert.png" width="15"/></imageobject><textobject><phrase>/!\</phrase></textobject></inlinemediaobject> Enabling/disabling this option (or installing <ulink url="http://www.nnx.me/HelpOnXapian/PyStemmer#">PyStemmer</ulink> later) needs a complete rebuild of your index! </para></listitem></itemizedlist></listitem></itemizedlist></section><section><title>(Re-)Building an index</title><para>You can use the supplied command line tool <emphasis>moin</emphasis> to initially build, completely rebuild and update an existing index. </para><para>To build your index the first time, execute </para><screen><![CDATA[moin index build --mode=add]]></screen><para>in your command line. You can check the status of Xapian and its index on <ulink url="http://www.nnx.me/HelpOnXapian/SystemInfo#">SystemInfo</ulink>. </para><para>Moreover, the following modes can be passed to the command above to control the building of the index: </para><itemizedlist><listitem><para><emphasis role="strong">add</emphasis> </para><itemizedlist><listitem override="none"><para>Items are added without checking if they are already in the index. Only use this mode if you haven't got an index already. </para></listitem></itemizedlist></listitem><listitem><para><emphasis role="strong">rebuild</emphasis> </para><itemizedlist><listitem override="none"><para>Before going into <emphasis>add</emphasis> mode, this option deletes the previous index, if existing. </para></listitem></itemizedlist></listitem><listitem><para><emphasis role="strong">update</emphasis> </para><itemizedlist><listitem override="none"><para>Updates every page in the index based on it's last modification date. </para><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/idea.png" width="16"/></imageobject><textobject><phrase>(!)</phrase></textobject></inlinemediaobject> Periodic invocations using this mode are <emphasis role="strong">not</emphasis> necessary as pages in the index will of course be updated upon change. This should only be used for debugging purposes if pages in the index are not up-to-date. </para></listitem></itemizedlist></listitem></itemizedlist><para><inlinemediaobject><imageobject><imagedata depth="15" fileref="http://www.nnx.me//moin_static197/ninuxtheme02/img/alert.png" width="15"/></imageobject><textobject><phrase>/!\</phrase></textobject></inlinemediaobject> Please note that you <emphasis role="strong">must</emphasis> <emphasis>rebuild</emphasis> your index if you change at least one of xapian_index_history, xapian_index_dir or xapian_stemming configuration options! </para></section><section><title>Testing</title><para>You can test if Xapian is enabled and if an index is available by checking <ulink url="http://www.nnx.me/HelpOnXapian/SystemInfo#">SystemInfo</ulink>. To check if searches are performed using Xapian, enable show_timings in your wikiconfig, perform a search and look for _xapianSearch on the bottom of the page. </para></section></section><section><title>Usage</title><para>Xapian is basically used the same way as all other search engines. Due to Xapian's advanced features some new search term prefixed were introduced which are not already available in the legacy search engine (commonly referred to as moin search). See <ulink url="http://www.nnx.me/HelpOnXapian/HelpOnSearching#">HelpOnSearching</ulink> for more information and/or use the new advanced search dialogue available on <ulink url="http://www.nnx.me/HelpOnXapian/FindPage#">FindPage</ulink> to see what's available and possible. </para></section></article>