|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectthinkmap.server.DataSourceIndex
public class DataSourceIndex
The <index> tag is used to add a full text index to a Thinkmap datasource.
| Field Summary | |
|---|---|
static int |
COMPACT
|
static int |
DAY
|
static int |
HOUR
|
static int |
MILLISECOND
|
static int |
MINUTE
|
static int |
MONTH
|
static int |
SECOND
|
protected String[] |
stopWords
|
protected SearchWrapper |
wrapper
|
static int |
YEAR
|
| Constructor Summary | |
|---|---|
DataSourceIndex(ThinkmapServerApplication app)
|
|
| Method Summary | |
|---|---|
protected void |
configureIndex(Indexer indexer)
|
void |
contextDestroyed(IThinkmapContext itc)
Called when the given context has been destroyed. |
void |
contextInitializing(IThinkmapContext itc)
Called when the given context is initializing. |
void |
contextStarting(IThinkmapContext itc)
Called when the given context is starting. |
void |
contextStopping(IThinkmapContext itc)
Called when the given context is stopping. |
IThinkmapContext |
getContext()
|
int |
getDateResolution()
Deprecated. |
int |
getDocumentCount()
Gets the number of documents in the index. |
int |
getDocumentsProcessed()
Gets the number of documents that have been processed so far while the indexer is indexing. |
String |
getIndexInterval()
Gets the indexing interval. |
File |
getIndexLocation()
Gets the directory that holds the full text index. |
Date |
getLastIndexTime()
Gets the last time this index was re-indexed. |
Date |
getNextIndexTime()
Returns the next time this index will be re-indexed, or null if there is no indexInterval set. |
long |
getProcessingTime()
Get the number of milliseconds that have elapsed since the start of indexing, or 0 if the indexer is not running. |
String |
getStatus()
Get a human-readable description of the status of the indexer. |
Element |
getStatusXML(Document doc)
Add XML for this DataSourceIndex |
protected File |
getTempDir()
|
protected SearchWrapper |
getWrapper()
|
boolean |
isIndexing()
Returns true if this index is currently indexing. |
void |
setConfig(ThinkmapConfig config)
|
void |
setDateResolution(int dateResolution)
Deprecated. |
void |
setIndexId(String indexId)
Sets the "id" of this index. |
void |
setIndexInterval(String cronSpec)
Set the indexing interval using a "cron-like" specification which is a number of fields separated by whitespace. |
void |
setIndexOnStart(boolean b)
If set to true, the datasource will be indexed on startup if no full-text index exists. |
void |
setIndexRoot(File f)
Sets the full path to the directory that will be used to store this full text index. |
void |
setStopWords(String[] words)
Set the list of words that the full-text index should ignore. |
void |
startIndexing()
Starts the process of reindexing in another thread. |
void |
stopIndexing()
Stops the indexer if it is currently running. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int YEAR
public static final int MONTH
public static final int DAY
public static final int HOUR
public static final int MINUTE
public static final int SECOND
public static final int MILLISECOND
public static final int COMPACT
protected String[] stopWords
protected SearchWrapper wrapper
| Constructor Detail |
|---|
public DataSourceIndex(ThinkmapServerApplication app)
| Method Detail |
|---|
public void setConfig(ThinkmapConfig config)
public void contextInitializing(IThinkmapContext itc)
throws Exception
IContextListener
contextInitializing in interface IContextListeneritc - the context that is initializing
Exception - if an error occurs while processing this event.protected SearchWrapper getWrapper()
protected File getTempDir()
throws IOException
IOExceptionprotected void configureIndex(Indexer indexer)
public void contextStarting(IThinkmapContext itc)
IContextListener
contextStarting in interface IContextListeneritc - the context that is startingpublic void contextStopping(IThinkmapContext itc)
IContextListener
contextStopping in interface IContextListeneritc - the context that is startingpublic void contextDestroyed(IThinkmapContext itc)
IContextListener
contextDestroyed in interface IContextListeneritc - the context that is being destroyedpublic void setIndexRoot(File f)
f - The full path to the directory that will be used to store this full
text index.public void setIndexId(String indexId)
indexId - the "id" of this index.public void setIndexInterval(String cronSpec)
Here is the format of the fields:
| field | allowed values |
|---|---|
| second | 0-59 |
| minute | 0-59 |
| hour | 0-23 |
| day of month | 1-31 |
| month | 0-11 (or names, see below) |
| day of week | 0-6 (0 is Sun, or use names) |
A field may be an asterisk (*), which always stands for "first-last".
Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. The specified range is inclu- sive. For example, 8-11 for an ``hours'' entry specifies execution at hours 8, 9, 10 and 11.
Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: "1,2,5,9", "0-4,8-12".
Step values can be used in conjunction with ranges. Fol- lowing a range with "/#" specifies skips of the number's value through the range. For example, ``0-23/2'' can be used in the hours field to specify execution every other hour (the alternative is to use "0,2,4,6,8,10,12,14,16,18,20,22"). Steps are also permitted after an asterisk, so if you want to say "every two hours", just use a "/2" after an "*".
Names can also be used for the "month" and "day of week" fields. Use the first three letters of the particular day or month (case doesn't matter).
Examples:
cronSpec - the indexing interval using a "cron-like" specificationpublic String getIndexInterval()
public IThinkmapContext getContext()
@Deprecated public void setDateResolution(int dateResolution)
@Deprecated public int getDateResolution()
public void setIndexOnStart(boolean b)
b - true if the datasource will be indexed on startup.public File getIndexLocation()
public boolean isIndexing()
public void setStopWords(String[] words)
words - the list of words that the index should ignore.public Date getNextIndexTime()
public Date getLastIndexTime()
public void startIndexing()
public void stopIndexing()
public int getDocumentCount()
public int getDocumentsProcessed()
public long getProcessingTime()
public String getStatus()
public Element getStatusXML(Document doc)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||