com.xpn.xwiki.plugin.lucene
Class IndexRebuilder

java.lang.Object
  extended by com.xpn.xwiki.plugin.lucene.AbstractXWikiRunnable
      extended by com.xpn.xwiki.plugin.lucene.IndexRebuilder
All Implemented Interfaces:
java.lang.Runnable

public class IndexRebuilder
extends AbstractXWikiRunnable

Handles rebuilding of the whole Lucene Search Index. This involves the following steps:

The rebuild can be triggered using the LucenePluginApi.rebuildIndex() method of the LucenePluginApi. Once a rebuild request is made, a new thread is created, so the requesting script can continue processing, while the rebuilding is done in the background. The actual indexing is done by the IndexUpdater thread, this thread just gathers the data and passes it to the IndexUpdater.

As a summary, this plugin:

Version:
$Id: $

Constructor Summary
IndexRebuilder(IndexUpdater indexUpdater, com.xpn.xwiki.XWikiContext context)
           
 
Method Summary
protected  int addTranslationsOfDocument(com.xpn.xwiki.doc.XWikiDocument document, com.xpn.xwiki.XWikiContext wikiContext)
           
protected  int indexWiki(java.lang.String wikiName, com.xpn.xwiki.XWikiContext context)
          Adds the content of a given wiki to the indexUpdater's queue.
 void run()
           
 int startRebuildIndex(com.xpn.xwiki.XWikiContext context)
           
 
Methods inherited from class com.xpn.xwiki.plugin.lucene.AbstractXWikiRunnable
cleanupXWikiContainer, initXWikiContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexRebuilder

public IndexRebuilder(IndexUpdater indexUpdater,
                      com.xpn.xwiki.XWikiContext context)
Method Detail

startRebuildIndex

public int startRebuildIndex(com.xpn.xwiki.XWikiContext context)

run

public void run()

indexWiki

protected int indexWiki(java.lang.String wikiName,
                        com.xpn.xwiki.XWikiContext context)
Adds the content of a given wiki to the indexUpdater's queue.

Parameters:
wikiName -
context -
Returns:

addTranslationsOfDocument

protected int addTranslationsOfDocument(com.xpn.xwiki.doc.XWikiDocument document,
                                        com.xpn.xwiki.XWikiContext wikiContext)


Copyright © 2004-2009 XWiki. All Rights Reserved.