| java.lang.Object vqwiki.AbstractSearchEngine
All known Subclasses: vqwiki.db.DatabaseSearchEngine, vqwiki.file.FileSearchEngine,
AbstractSearchEngine | abstract public class AbstractSearchEngine implements SearchEngine(Code) | | Abstract class to do the search.
This class was created on 09:59:41 04.08.2003
author: tobsch |
Method Summary | |
public synchronized void | add(String virtualWiki, String topic, String contents) Adds to the in-memory table. | protected Document | createDocument(String currentWiki, String topic) | protected Collection | doSearch(String virtualWiki, String text, boolean caseInsensitiveSearch, boolean doTextBeforeAndAfterParsing) Actually perform the search. | public Collection | find(String virtualWiki, String text, boolean doTextBeforeAndAfterParsing) Find topics that contain the given term. | public Collection | findLinkedTo(String virtualWiki, String topicName) | public Collection | findMultiple(String virtualWiki, String text, boolean fuzzy) Find topics that contain any of the space delimited terms. | abstract protected String | getFilename(String currentWiki, String topic) | protected Directory | getIndexDirectory(File indexFile, boolean create) | protected Directory | getIndexDirectory(String indexFilename, boolean create) | public String | getSearchIndexPath(String virtualWiki) | public void | indexText(String virtualWiki, String topic, String text) | protected void | initSearchEngine(ServletContext ctx) | protected void | initSearchEngine(String iP) | public synchronized void | rebuild() | public void | refreshIndex() Should be called by a monitor thread at regular intervals, rebuilds the
entire seach index to account for removed items. |
ITYPE_CONTENT | final protected static String ITYPE_CONTENT(Code) | | Index type "content"
|
ITYPE_CONTENT_PLAIN | final protected static String ITYPE_CONTENT_PLAIN(Code) | | Index type "content plain"
|
ITYPE_FILE | final protected static String ITYPE_FILE(Code) | | Index type "File"
|
ITYPE_TOPIC | final protected static String ITYPE_TOPIC(Code) | | Index type "topic"
|
ITYPE_TOPIC_PLAIN | final protected static String ITYPE_TOPIC_PLAIN(Code) | | Index type "topic plain"
|
indexPath | protected static String indexPath(Code) | | Temp directory - where to store the indexes (initialized via getInstance method)
|
add | public synchronized void add(String virtualWiki, String topic, String contents) throws IOException(Code) | | Adds to the in-memory table. Does not remove indexed items that are
no longer valid due to deletions, edits etc.
|
createDocument | protected Document createDocument(String currentWiki, String topic) throws Exception(Code) | | Create a document to add to the search index
Parameters: currentWiki - Name of this wiki Parameters: topic - Name of the topic to add The document to add |
doSearch | protected Collection doSearch(String virtualWiki, String text, boolean caseInsensitiveSearch, boolean doTextBeforeAndAfterParsing)(Code) | | Actually perform the search.
Parameters: virtualWiki - The virtual wiki to use Parameters: text - The text to find Parameters: caseInsensitiveSearch - true, if case does not matter in search, false otherwise A collection of SearchResultEntry, containing the search results |
find | public Collection find(String virtualWiki, String text, boolean doTextBeforeAndAfterParsing)(Code) | | Find topics that contain the given term.
Note: Use this method ONLY to search for topics!
Parameters: virtualWiki - The virtual wiki to use Parameters: text - The text to find Parameters: fuzzy - true, if fuzzy search should be used, false otherwise A collection of SearchResultEntry, containing the search results |
findLinkedTo | public Collection findLinkedTo(String virtualWiki, String topicName) throws Exception(Code) | | Find topics that contain a link to the given topic name
Parameters: virtualWiki - the virtual wiki to look in Parameters: topicName - the topic being searched for A collection of SearchResultEntry, containing the search results |
findMultiple | public Collection findMultiple(String virtualWiki, String text, boolean fuzzy)(Code) | | Find topics that contain any of the space delimited terms.
Note: Use this method for full text search.
Parameters: virtualWiki - The virtual wiki to use Parameters: text - The text to find Parameters: fuzzy - true, if fuzzy search should be used, false otherwise A collection of SearchResultEntry, containing the search results |
getFilename | abstract protected String getFilename(String currentWiki, String topic)(Code) | | Parameters: currentWiki - Parameters: topic - |
getIndexDirectory | protected Directory getIndexDirectory(File indexFile, boolean create) throws IOException(Code) | | Parameters: indexFile - |
getIndexDirectory | protected Directory getIndexDirectory(String indexFilename, boolean create) throws IOException(Code) | | Parameters: indexFilename - |
getSearchIndexPath | public String getSearchIndexPath(String virtualWiki)(Code) | | Get the path, which holds all index files
|
rebuild | public synchronized void rebuild() throws Exception(Code) | | Trawls all the files in the wiki directory and indexes them
|
refreshIndex | public void refreshIndex() throws Exception(Code) | | Should be called by a monitor thread at regular intervals, rebuilds the
entire seach index to account for removed items. Due to the additive rather
than subtractive nature of a Wiki, it probably only needs to be called once
or twice a day
|
|
|