Unpack the distribution archive and copy xwiki-lucene-plugin-x.y.jar and all jars from lib/ to WEB-INF/lib inside your xwiki webapp.
Edit xwiki.cfg (located in the WEB-INF dir of your xwiki web application directory):
xwiki.plugins=com.xpn.xwiki.plugin.calendar.CalendarPlugin,net.jkraemer.xwiki.plugins.lucene.LucenePlugin
xwiki.plugins.lucene.indexdir=/path/to/index/
xwiki.plugins.lucene.analyzer=org.apache.lucene.analysis.de.GermanAnalyzer # xwiki.plugins.lucene.analyzer=org.apache.lucene.analysis.ru.RussianAnalyzer # xwiki.plugins.lucene.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer
xwiki.plugins.lucene.indexinterval=300
Now restart the application server.
Insert the content of searchForm.vm into a wiki page of your choice. Customize it to fit your needs. The number of results to show per page is defined in the very first line where the variable itemsPerPage is defined.
If you want to build your own search form from scratch, you should have a look at the API docs of LucenePluginApi, SearchResults and SearchResult.
If you intend to keep up with the nice internationalization features of xwiki, you can add the message keys used for presenting the searchresults to the Application Resources files located in WEB-INF/classes. This is completely optional, if you only use one language you can hard wire the Strings in your Search results page as well. The message keys used are:
To build up the index of all existing documents in your wiki log in as a user having admin rights, and view the page you just created. There should be a link saying 'rebuild Index'. Alternatively you can simply append the url parameter rebuild=yes to the url of this page. You will need to be logged as Admin for this to be successful in any case. After a short time there should be a line telling you how many documents have been scheduled for addition to the index. Attachments and translations count as documents by themselves. Note that the index won't be built immediately, it can take up to xwiki.plugins.lucene.indexinterval (by default 300 seconds) until the thread doing the indexing work wakes up and checks its queue for documents to be indexed. The same is true for the automatic index updates due to changes you make in documents.
In case of any trouble set
log4j.logger.net.jkraemer.xwiki=debug
Please contact me if you think you've found a bug, but always try to give me as much information as possible to ease tracking down the problem.
This is easy. Just copy the file templates/viewtoolbar.vm to
skins/yourskin/viewtoolbar.vm and change the document name in the line
#set($searchdoc = $xwiki.getDocument("Main.WebSearch"))
to the name of the document containing your Lucene based searchform.
If you don't want to do so for any reason, you can also simply change the original search page to contain the lucene search form instead of the original one.