com.xpn.xwiki.plugin.lucene
Class LucenePlugin

java.lang.Object
  extended by com.xpn.xwiki.plugin.XWikiDefaultPlugin
      extended by com.xpn.xwiki.plugin.lucene.LucenePlugin
All Implemented Interfaces:
XWikiPluginInterface

Deprecated. the plugin technology is deprecated

@Deprecated
public class LucenePlugin
extends XWikiDefaultPlugin

A plugin offering support for advanced searches using Lucene, a high performance, open source search engine. It uses an IndexUpdater to monitor and submit wiki pages for indexing to the Lucene engine, and offers simple methods for searching documents, with the possiblity to sort by one or several document fields (besides the default sort by relevance), filter by one or several languages, and search in one, several or all virtual wikis.

Version:
$Id: 6e1a2cc037d8520dc2c5288ddab8b4eb033f841a $

Field Summary
static String DOCTYPE_ATTACHMENT
          Deprecated.  
static String DOCTYPE_WIKIPAGE
          Deprecated.  
protected  Thread indexUpdaterThread
          Deprecated. The thread running the index updater.
static String PROP_ANALYZER
          Deprecated.  
static String PROP_INDEX_DIR
          Deprecated.  
static String PROP_INDEXING_INTERVAL
          Deprecated.  
static String PROP_MAX_QUEUE_SIZE
          Deprecated.  
 
Constructor Summary
LucenePlugin(String name, String className, XWikiContext context)
          Deprecated.  
 
Method Summary
 org.apache.lucene.index.IndexReader[] createIndexReaders(String indexDirs, XWikiContext context)
          Deprecated. Creates an array of readers for a number of lucene indexes.
protected  void finalize()
          Deprecated.  
 void flushCache(XWikiContext context)
          Deprecated.  
 String getIndexDirs()
          Deprecated.  
 long getLuceneDocCount()
          Deprecated.  
 String getName()
          Deprecated.  
 Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
          Deprecated.  
 long getQueueSize()
          Deprecated.  
 SearchResults getSearchResults(String query, String[] sortField, String virtualWikiNames, String languages, XWikiContext context)
          Deprecated. Searches all Indexes configured in xwiki.cfg (property xwiki.plugins.lucene.indexdir).
 SearchResults getSearchResults(String query, String sortField, String virtualWikiNames, String languages, XWikiContext context)
          Deprecated. Searches all Indexes configured in xwiki.cfg (property xwiki.plugins.lucene.indexdir).
 SearchResults getSearchResultsFromIndexes(String query, String[] sortFields, String myIndexDirs, String languages, XWikiContext context)
          Deprecated. Allows to search special named lucene indexes without having to configure them in xwiki.cfg.
 SearchResults getSearchResultsFromIndexes(String query, String sortField, String myIndexDirs, String languages, XWikiContext context)
          Deprecated. Allows to search special named lucene indexes without having to configure them in xwiki.cfg.
 SearchResults getSearchResultsFromIndexes(String query, String myIndexDirs, String languages, XWikiContext context)
          Deprecated. Allows to search special named lucene indexes without having to configure them in xwiki.cfg.
 void handleCorruptIndex(XWikiContext context)
          Deprecated. Handle a corrupt index by clearing it and rebuilding from scratch.
 void init(org.apache.lucene.store.Directory directory, XWikiContext context)
          Deprecated.  
 void init(com.xpn.xwiki.plugin.lucene.internal.IndexUpdater indexUpdater, com.xpn.xwiki.plugin.lucene.internal.IndexRebuilder indexRebuilder, XWikiContext context)
          Deprecated.  
 void init(com.xpn.xwiki.plugin.lucene.internal.IndexUpdater indexUpdater, XWikiContext context)
          Deprecated.  
 void init(XWikiContext context)
          Deprecated.  
 void openIndexReaders(XWikiContext context)
          Deprecated. Opens the readers for the configured index Dirs after closing any already existing ones.
 void queueAttachment(XWikiDocument doc, XWikiAttachment attach, XWikiContext context)
          Deprecated.  
 void queueAttachment(XWikiDocument doc, XWikiContext context)
          Deprecated.  
 void queueDocument(XWikiDocument doc, XWikiContext context)
          Deprecated.  
 int rebuildIndex(XWikiContext context)
          Deprecated.  
 int startIndex(Collection<String> wikis, String hqlFilter, boolean clearIndex, boolean onlyNew, XWikiContext context)
          Deprecated.  
 
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endParsing, endRendering, endRenderingHandler, flushCache, getClassName, insidePREHandler, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCTYPE_WIKIPAGE

public static final String DOCTYPE_WIKIPAGE
Deprecated. 
See Also:
Constant Field Values

DOCTYPE_ATTACHMENT

public static final String DOCTYPE_ATTACHMENT
Deprecated. 
See Also:
Constant Field Values

PROP_INDEX_DIR

public static final String PROP_INDEX_DIR
Deprecated. 
See Also:
Constant Field Values

PROP_ANALYZER

public static final String PROP_ANALYZER
Deprecated. 
See Also:
Constant Field Values

PROP_INDEXING_INTERVAL

public static final String PROP_INDEXING_INTERVAL
Deprecated. 
See Also:
Constant Field Values

PROP_MAX_QUEUE_SIZE

public static final String PROP_MAX_QUEUE_SIZE
Deprecated. 
See Also:
Constant Field Values

indexUpdaterThread

protected Thread indexUpdaterThread
Deprecated. 
The thread running the index updater.

Constructor Detail

LucenePlugin

public LucenePlugin(String name,
                    String className,
                    XWikiContext context)
Deprecated. 
Method Detail

getName

public String getName()
Deprecated. 
Specified by:
getName in interface XWikiPluginInterface
Overrides:
getName in class XWikiDefaultPlugin

getPluginApi

public Api getPluginApi(XWikiPluginInterface plugin,
                        XWikiContext context)
Deprecated. 
Specified by:
getPluginApi in interface XWikiPluginInterface
Overrides:
getPluginApi in class XWikiDefaultPlugin

finalize

protected void finalize()
                 throws Throwable
Deprecated. 
Overrides:
finalize in class Object
Throws:
Throwable

rebuildIndex

public int rebuildIndex(XWikiContext context)
Deprecated. 

startIndex

public int startIndex(Collection<String> wikis,
                      String hqlFilter,
                      boolean clearIndex,
                      boolean onlyNew,
                      XWikiContext context)
Deprecated. 

getSearchResultsFromIndexes

public SearchResults getSearchResultsFromIndexes(String query,
                                                 String myIndexDirs,
                                                 String languages,
                                                 XWikiContext context)
                                          throws Exception
Deprecated. 
Allows to search special named lucene indexes without having to configure them in xwiki.cfg. Slower than getSearchResults(String, String, String, String, XWikiContext) since new index searcher instances are created for every query.

Parameters:
query - The base query, using the query engine supported by Lucene.
myIndexDirs - Comma separated list of directories containing the lucene indexes to search.
languages - Comma separated list of language codes to search in, may be null or empty to search all languages.
context - The context of the request.
Returns:
The list of search results.
Throws:
Exception - If the index directories cannot be read, or the query is invalid.

getSearchResultsFromIndexes

public SearchResults getSearchResultsFromIndexes(String query,
                                                 String[] sortFields,
                                                 String myIndexDirs,
                                                 String languages,
                                                 XWikiContext context)
                                          throws Exception
Deprecated. 
Allows to search special named lucene indexes without having to configure them in xwiki.cfg. Slower than getSearchResults(java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.xpn.xwiki.XWikiContext)since new index searcher instances are created for every query.

Parameters:
query - The base query, using the query engine supported by Lucene.
sortFields - A list of fields to sort results by. For each field, if the name starts with '-', then that field (excluding the -) is used for reverse sorting. If null or empty, sort by hit score.
myIndexDirs - Comma separated list of directories containing the lucene indexes to search.
languages - Comma separated list of language codes to search in, may be null or empty to search all languages.
context - The context of the request.
Returns:
The list of search results.
Throws:
Exception - If the index directories cannot be read, or the query is invalid.

getSearchResultsFromIndexes

public SearchResults getSearchResultsFromIndexes(String query,
                                                 String sortField,
                                                 String myIndexDirs,
                                                 String languages,
                                                 XWikiContext context)
                                          throws Exception
Deprecated. 
Allows to search special named lucene indexes without having to configure them in xwiki.cfg. Slower than getSearchResults(String, String, String, String, XWikiContext) since new index searcher instances are created for every query.

Parameters:
query - The base query, using the query engine supported by Lucene.
sortField - The name of a field to sort results by. If the name starts with '-', then the field (excluding the -) is used for reverse sorting. If null or empty, sort by hit score.
myIndexDirs - Comma separated list of directories containing the lucene indexes to search.
languages - Comma separated list of language codes to search in, may be null or empty to search all languages.
context - The context of the request.
Returns:
The list of search results.
Throws:
Exception - If the index directories cannot be read, or the query is invalid.

getSearchResults

public SearchResults getSearchResults(String query,
                                      String sortField,
                                      String virtualWikiNames,
                                      String languages,
                                      XWikiContext context)
                               throws Exception
Deprecated. 
Searches all Indexes configured in xwiki.cfg (property xwiki.plugins.lucene.indexdir).

Parameters:
query - The base query, using the query engine supported by Lucene.
sortField - The name of a field to sort results by. If the name starts with '-', then the field (excluding the -) is used for reverse sorting. If null or empty, sort by hit score.
virtualWikiNames - Comma separated list of virtual wiki names to search in, may be null to search all virtual wikis.
languages - Comma separated list of language codes to search in, may be null or empty to search all languages.
context - The context of the request.
Returns:
The list of search results.
Throws:
Exception - If the index directories cannot be read, or the query is invalid.

getSearchResults

public SearchResults getSearchResults(String query,
                                      String[] sortField,
                                      String virtualWikiNames,
                                      String languages,
                                      XWikiContext context)
                               throws Exception
Deprecated. 
Searches all Indexes configured in xwiki.cfg (property xwiki.plugins.lucene.indexdir).

Parameters:
query - The base query, using the query engine supported by Lucene.
sortField - The name of a field to sort results by. If the name starts with '-', then the field (excluding the -) is used for reverse sorting. If null or empty, sort by hit score.
virtualWikiNames - Comma separated list of virtual wiki names to search in, may be null to search all virtual wikis.
languages - Comma separated list of language codes to search in, may be null or empty to search all languages.
context - The context of the request.
Returns:
The list of search results.
Throws:
Exception - If the index directories cannot be read, or the query is invalid.

init

public void init(XWikiContext context)
Deprecated. 
Specified by:
init in interface XWikiPluginInterface
Overrides:
init in class XWikiDefaultPlugin

init

public void init(org.apache.lucene.store.Directory directory,
                 XWikiContext context)
Deprecated. 

init

public void init(com.xpn.xwiki.plugin.lucene.internal.IndexUpdater indexUpdater,
                 XWikiContext context)
Deprecated. 

init

public void init(com.xpn.xwiki.plugin.lucene.internal.IndexUpdater indexUpdater,
                 com.xpn.xwiki.plugin.lucene.internal.IndexRebuilder indexRebuilder,
                 XWikiContext context)
Deprecated. 

flushCache

public void flushCache(XWikiContext context)
Deprecated. 
Specified by:
flushCache in interface XWikiPluginInterface
Overrides:
flushCache in class XWikiDefaultPlugin

createIndexReaders

public org.apache.lucene.index.IndexReader[] createIndexReaders(String indexDirs,
                                                                XWikiContext context)
                                                         throws Exception
Deprecated. 
Creates an array of readers for a number of lucene indexes.

Parameters:
indexDirs - Comma separated list of Lucene index directories to create readers for.
Returns:
Array of readers
Throws:
Exception

openIndexReaders

public void openIndexReaders(XWikiContext context)
Deprecated. 
Opens the readers for the configured index Dirs after closing any already existing ones.


getIndexDirs

public String getIndexDirs()
Deprecated. 

getQueueSize

public long getQueueSize()
Deprecated. 

queueDocument

public void queueDocument(XWikiDocument doc,
                          XWikiContext context)
Deprecated. 

queueAttachment

public void queueAttachment(XWikiDocument doc,
                            XWikiAttachment attach,
                            XWikiContext context)
Deprecated. 

queueAttachment

public void queueAttachment(XWikiDocument doc,
                            XWikiContext context)
Deprecated. 

getLuceneDocCount

public long getLuceneDocCount()
Deprecated. 
Returns:
the number of documents Lucene index writer.

handleCorruptIndex

public void handleCorruptIndex(XWikiContext context)
                        throws IOException
Deprecated. 
Handle a corrupt index by clearing it and rebuilding from scratch.

Throws:
IOException


Copyright © 2004-2013 XWiki. All Rights Reserved.