static void |
rebuild(java.util.Properties oProps,
java.lang.String sTableName,
java.lang.String sWorkArea)
Rebuild Full Text Index for a table restricting to a given WorkArea
Indexed documents have the following fields:
Field NameDescriptionIndexedStored
workareaGUID of WorkAreaYes | Yes
containerName of Container (NewsGroup, Project, etc) | Yes | Yes
guidGUID for Retrieved Object | Yes | Yes
numberObject Ordinal Identifier | Yes | Yes
titleTitle or Subject | Yes | Yes
authorAuthor | Yes | Yes
textDocument Text | Yes | No
abstractFirst 80 characters of text | No | Yes
|
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
instantiateAnalyzer
public static org.apache.lucene.analysis.Analyzer instantiateAnalyzer(java.util.Properties oProps)
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
Instantiate a subclass of org.apache.lucene.analysis.Analyzer
- Parameters:
oProps - Properties Must contain a property named "analyzer" which is
the full class name of the desired Analyzer subclass. If no analyzer property
is set then org.apache.lucene.analysis.StopAnalyzer is instantiated by default.
- Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException - Since:
- 7.0
-
optimize
public static void optimize(java.util.Properties oProps,
java.lang.String sTableName,
java.lang.String sWorkArea)
throws java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.ClassNotFoundException,
java.io.FileNotFoundException,
java.io.IOException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
Optimize a given index
- Parameters:
oProps - Properties Collection (typically loaded from hipergate.cnf)
containing luceneindex property and (optionally) analyzersTableName - String Name of table to be indexed (currently only k_bugs, k_newsmsgs or k_mime_msgs are permitted)sWorkArea - GUID of WorkArea to be optimized
- Throws:
java.lang.NoSuchFieldException
java.lang.IllegalArgumentException
java.lang.ClassNotFoundException
java.io.IOException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.FileNotFoundException
-
rebuild
public static void rebuild(java.util.Properties oProps,
java.lang.String sTableName,
java.lang.String sWorkArea)
throws java.sql.SQLException,
java.io.IOException,
java.lang.ClassNotFoundException,
java.lang.IllegalArgumentException,
java.lang.NoSuchFieldException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
Rebuild Full Text Index for a table restricting to a given WorkArea
Indexed documents have the following fields:
Field Name | Description | Indexed | Stored |
workarea | GUID of WorkArea | Yes | Yes |
container | Name of Container (NewsGroup, Project, etc) | Yes | Yes |
guid | GUID for Retrieved Object | Yes | Yes |
number | Object Ordinal Identifier | Yes | Yes |
title | Title or Subject | Yes | Yes |
author | Author | Yes | Yes |
text | Document Text | Yes | No |
abstract | First 80 characters of text | No | Yes |
- Parameters:
oProps - Properties Collection (typically loaded from hipergate.cnf) containing:
driver : Class name for JDBC driver
dburl : Database Connection URL
dbuser : Database User
dbpassword : Database User Password
luceneindex : Base path for Lucene index directories,
the rebuilded index will be stored at a subdirectory called as the table name.
sTableName - Name of table to be indexed (currently only k_bugs, k_newsmsgs or k_mime_msgs are permitted)
analyzer : org.apache.lucene.analysis.Analyzer subclass namesWorkArea - GUID of WorkArea to be rebuilt
- Throws:
java.lang.NoSuchFieldException - If any of the requiered properties of oProps is not found
java.lang.ClassNotFoundException - If JDBC driver or analyzer classes are not found
java.sql.SQLException
java.io.IOException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.InstantiationException
-
rebuild
public static void rebuild(java.util.Properties oProps,
java.lang.String sTableName)
throws java.sql.SQLException,
java.io.IOException,
java.lang.ClassNotFoundException,
java.lang.IllegalArgumentException,
java.lang.NoSuchFieldException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
Rebuild Full Text Index for a table for all WorkAreas
- Parameters:
oProps - sTableName -
- Throws:
java.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.IllegalArgumentException
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
java.lang.InstantiationException
-
add
public static void add(org.apache.lucene.index.IndexWriter oIWrt,
java.util.Map oKeywords,
java.util.Map oTexts,
java.util.Map oUnStored)
throws java.lang.ClassNotFoundException,
java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.NoSuchFieldException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.lang.NullPointerException
- Throws:
java.lang.ClassNotFoundException
java.io.IOException
java.lang.IllegalArgumentException
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.NullPointerException
-
add
public static void add(java.lang.String sTableName,
java.lang.String sDirectory,
java.lang.String sAnalyzer,
java.util.Map oKeywords,
java.util.Map oTexts,
java.util.Map oUnStored)
throws java.lang.ClassNotFoundException,
java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.NoSuchFieldException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.lang.NullPointerException
- Throws:
java.lang.ClassNotFoundException
java.io.IOException
java.lang.IllegalArgumentException
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.NullPointerException
-
add
public static void add(java.lang.String sTableName,
java.util.Properties oProps,
java.lang.String sGUID,
int iNumber,
java.lang.String sWorkArea,
java.lang.String sContainer,
java.lang.String sTitle,
java.lang.String sText,
java.lang.String sAuthor,
java.lang.String sAbstract,
java.lang.String sComments)
throws java.lang.ClassNotFoundException,
java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.NoSuchFieldException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.lang.NullPointerException
Deprecated. Use add method from Indexer subclasses instead
Add a document to the index
- Parameters:
sTableName - k_bugs, k_newsmsgs or k_mime_msgsoProps - Properties Collection containing luceneindex directorysWorkArea - WorkArea for documentsContainer - GUID of Category or NewsGroup to which documento belongssGUID - Document GUIDiNumber - Document number (optional, may be zero)sTitle - Document Title (optional, may be null)sText - Document text (optional, may be null)sAuthor - Document author (optional, may be null)sAbstract - Document abstract (optional, may be null)sComments - Document comments (optional, may be null)
- Throws:
java.lang.ClassNotFoundException
java.io.IOException
java.lang.IllegalArgumentException - If sTableName is not one of { k_bugs, k_newsmsgs, k_mime_msgs }
java.lang.NoSuchFieldException - If luceneindex property is not found at oProps
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.NullPointerException
-
delete
public static int delete(java.lang.String sTableName,
java.lang.String sWorkArea,
java.util.Properties oProps,
java.lang.String sGuid)
throws java.lang.IllegalArgumentException,
java.lang.NoSuchFieldException,
java.lang.IllegalAccessException,
java.io.IOException,
java.lang.NullPointerException
Delete a document with a given GUID
- Parameters:
sTableName - k_bugs, k_newsmsgs or k_mime_msgsoProps - Properties Collection containing luceneindex directorysGuid - Document GUID
- Returns:
- Number of documents deleted
- Throws:
java.lang.IllegalArgumentException - If sTableName is not one of { k_bugs, k_newsmsgs, k_mime_msgs }
java.lang.NoSuchFieldException - If luceneindex property is not found at oProps
java.lang.IllegalAccessException
java.io.IOException
java.lang.NullPointerException - If sGuid is null
-
main
public static void main(java.lang.String[] argv)
throws java.sql.SQLException,
java.io.IOException,
java.lang.ClassNotFoundException,
java.lang.IllegalArgumentException,
java.lang.NoSuchFieldException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
Static method for calling indexer from the command line
- Parameters:
argv - String[] Must have two arguments, the first one is the full path
to hipergate.cnf or other properties file containing database connection parameters.
The second argument must be "rebuild".
The third argument is one of {k_bugs|k_newsmsgs|k_mime_msgs} indicating which table index is to be rebuilt.
Command line example: java -cp ... com.knowgate.lucene.Indexer /etc/hipergate.cnf rebuild k_mime_msgs
- Throws:
java.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.IllegalArgumentException
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
java.lang.InstantiationException
|