Lucene Plugin

The Lucene Plugin uses Lucene to asynchronously index the documents in the wiki/farm. The plugin is enabled by default in XWiki, so you will find it in the "xwiki.plugins" list of the xwiki.cfg file:


The dedicated section in the xwiki.cfg file allows you to further customize the Lucene search engine:

#-# Lucene search engine
#-# Location where to place the lucene index files. The default is the "lucene" subdirectory in XWiki's permanent data
#-# directory. Change it if you want to store indexes in another place.
# xwiki.plugins.lucene.indexdir=/usr/local/xwiki/lucene
#-# The text analyzer to use for indexing.
# xwiki.plugins.lucene.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer
#-# The number of seconds to wait between reindexes. A smaller value ensures that new documents will be indexed faster,
#-# but with a minor performance reduction. Adjust according to your wiki load.
# xwiki.plugins.lucene.indexinterval=20
#-# The maximum size of the indexing queue. After this limit is reached, the reindex thread will have to wait until the
#-# queue is consumed. Note that this does not affect documents submitted through the notification mechanism, only the
#-# full reindex option.
# xwiki.plugins.lucene.maxQueueSize=1000

The default folder that stores the Lucene index is <permanent directory>/lucene but you can change it by editing the xwiki.plugins.lucene.indexdir parameter. 

The xwiki.plugins.lucene.analyzer parameter is the default Lucene Analyzer which converts all words in lowercase and filters out simple words such as "the", "a". Other available analyzers are listed at this link.

The xwiki.plugins.lucene.indexinterval parameter controls how frequently the plugin starts an indexation thread. The value is in seconds. 

The xwiki.plugins.lucene.maxQueueSize parameter sets the maximum number of elements in the indexing queue. Most importantly, this property only affects the "Index the whole farm" option. 

More information is available in the "Search Application" and "Customizing the Search Feature" documentation pages listed in the "Related Pages" section.

The source code is available on GitHub at xwiki-platform-search-lucene


Related Pages

Trying to decide between Cloud and On Premise? See the comparison on the XWiki Help Center.

Search this space