|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wiki.search.LuceneSearchProvider
public class LuceneSearchProvider

Interface for the search providers that handle searching the Wiki
| Field Summary | |
|---|---|
static int |
FLAG_CONTEXTS
Create contexts also. |
protected static org.apache.log4j.Logger |
log
|
protected static String |
LUCENE_ATTACHMENTS
|
protected static String |
LUCENE_AUTHOR
|
protected static String |
LUCENE_ID
|
protected static String |
LUCENE_PAGE_CONTENTS
|
protected static String |
LUCENE_PAGE_NAME
|
protected Vector<Object[]> |
m_updates
|
static int |
MAX_SEARCH_HITS
The maximum number of hits to return from searches. |
static String |
PROP_LUCENE_ANALYZER
Which analyzer to use. |
static String[] |
SEARCHABLE_FILE_SUFFIXES
These attachment file suffixes will be indexed. |
| Fields inherited from interface org.apache.wiki.WikiProvider |
|---|
LATEST_VERSION |
| Constructor Summary | |
|---|---|
LuceneSearchProvider()
|
|
| Method Summary | |
|---|---|
protected void |
doFullLuceneReindex()
Performs a full Lucene reindex, if necessary. |
Collection |
findPages(String query)
Search for pages matching a search query |
Collection |
findPages(String query,
int flags)
Searches pages using a particular combination of flags. |
protected String |
getAttachmentContent(Attachment att)
|
protected String |
getAttachmentContent(String attachmentName,
int version)
Fetches the attachment content from the repository. |
protected WikiEngine |
getEngine()
Returns the handling engine. |
String |
getProviderInfo()
Return a valid HTML string for information. |
void |
initialize(WikiEngine engine,
Properties props)
Initializes the page provider. |
protected org.apache.lucene.document.Document |
luceneIndexPage(WikiPage page,
String text,
org.apache.lucene.index.IndexWriter writer)
Indexes page using the given IndexWriter. |
void |
pageRemoved(WikiPage page)
Delete a page from the search index |
void |
reindexPage(WikiPage page)
Adds a page-text pair to the lucene update queue. |
protected void |
updateLuceneIndex(WikiPage page,
String text)
Updates the lucene index for a single page. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
public static final String PROP_LUCENE_ANALYZER
public static final String[] SEARCHABLE_FILE_SUFFIXES
protected static final String LUCENE_ID
protected static final String LUCENE_PAGE_CONTENTS
protected static final String LUCENE_AUTHOR
protected static final String LUCENE_ATTACHMENTS
protected static final String LUCENE_PAGE_NAME
protected Vector<Object[]> m_updates
public static final int MAX_SEARCH_HITS
public static final int FLAG_CONTEXTS
| Constructor Detail |
|---|
public LuceneSearchProvider()
| Method Detail |
|---|
public void initialize(WikiEngine engine,
Properties props)
throws NoRequiredPropertyException,
IOException
initialize in interface WikiProviderengine - WikiEngine to own this providerprops - A set of properties used to initialize this provider
NoRequiredPropertyException - If the provider needs a property which is not found in the property set
IOException - If there is an IO problemprotected WikiEngine getEngine()
protected void doFullLuceneReindex()
throws IOException
IOException - If there's a problem during indexing
protected String getAttachmentContent(String attachmentName,
int version)
attachmentName - Name of the attachment.version - The version of the attachment.
protected String getAttachmentContent(Attachment att)
att - Attachment to get content for. Filename extension is used to determine the type of the attachment.
protected void updateLuceneIndex(WikiPage page,
String text)
page - The WikiPage to checktext - The page text to index.
protected org.apache.lucene.document.Document luceneIndexPage(WikiPage page,
String text,
org.apache.lucene.index.IndexWriter writer)
throws IOException
page - WikiPagetext - Page text to indexwriter - The Lucene IndexWriter to use for indexing
IOException - If there's an indexing problempublic void pageRemoved(WikiPage page)
pageRemoved in interface SearchProviderpage - Page to remove from search indexpublic void reindexPage(WikiPage page)
reindexPage in interface SearchProviderpage - WikiPage to add to the update queue.
public Collection findPages(String query)
throws ProviderException
findPages in interface SearchProviderquery - query to search for
ProviderException - if the search provider failed.
public Collection findPages(String query,
int flags)
throws ProviderException
query - The query to perform in Lucene query languageflags - A set of flags
ProviderException - if there is a problem with the backendpublic String getProviderInfo()
getProviderInfo in interface WikiProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||