| java.lang.Object com.knowgate.lucene.Indexer
All known Subclasses: com.knowgate.lucene.NewsMessageIndexer, com.knowgate.lucene.MailIndexer, com.knowgate.lucene.BugIndexer,
Indexer | public class Indexer (Code) | | Data Feeder from hipergate tables for Lucene
author: Sergio Montoro Ten version: 3.0 See Also: http://jakarta.apache.org/lucene/docs/index.html |
Method Summary | |
public static void | add(IndexWriter oIWrt, Map oKeywords, Map oTexts, Map oUnStored) | public static void | add(String sTableName, String sDirectory, String sAnalyzer, Map oKeywords, Map oTexts, Map oUnStored) | public static void | add(String sTableName, Properties oProps, String sGUID, int iNumber, String sWorkArea, String sContainer, String sTitle, String sText, String sAuthor, String sAbstract, String sComments) | public static int | delete(String sTableName, String sWorkArea, Properties oProps, String sGuid) | public static void | main(String[] argv) Static method for calling indexer from the command line
Parameters: argv - String[] Must have two arguments, the first one is the full pathto 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 ... | public static void | optimize(Properties oProps, String sTableName, String sWorkArea) | public static void | rebuild(Properties oProps, String sTableName, String sWorkArea) | public static void | rebuild(Properties oProps, String sTableName) |
DEFAULT_ANALYZER | final public static String DEFAULT_ANALYZER(Code) | | |
add | public static void add(String sTableName, String sDirectory, String sAnalyzer, Map oKeywords, Map oTexts, Map oUnStored) throws ClassNotFoundException, IOException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException, InstantiationException, NullPointerException(Code) | | |
add | public static void add(String sTableName, Properties oProps, String sGUID, int iNumber, String sWorkArea, String sContainer, String sTitle, String sText, String sAuthor, String sAbstract, String sComments) throws ClassNotFoundException, IOException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException, InstantiationException, NullPointerException(Code) | | Add a document to the index
Parameters: sTableName - k_bugs, k_newsmsgs or k_mime_msgs Parameters: oProps - Properties Collection containing luceneindex directory Parameters: sWorkArea - WorkArea for document Parameters: sContainer - GUID of Category or NewsGroup to which documento belongs Parameters: sGUID - Document GUID Parameters: iNumber - Document number (optional, may be zero) Parameters: sTitle - Document Title (optional, may be null) Parameters: sText - Document text (optional, may be null) Parameters: sAuthor - Document author (optional, may be null) Parameters: sAbstract - Document abstract (optional, may be null) Parameters: sComments - Document comments (optional, may be null) throws: ClassNotFoundException - throws: IOException - throws: IllegalArgumentException - If sTableName is not one of { k_bugs, k_newsmsgs, k_mime_msgs } throws: NoSuchFieldException - If luceneindex property is not found at oProps throws: IllegalAccessException - throws: InstantiationException - throws: NullPointerException - |
delete | public static int delete(String sTableName, String sWorkArea, Properties oProps, String sGuid) throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException, IOException, NullPointerException(Code) | | Delete a document with a given GUID
Parameters: sTableName - k_bugs, k_newsmsgs or k_mime_msgs Parameters: oProps - Properties Collection containing luceneindex directory Parameters: sGuid - Document GUID Number of documents deleted throws: IllegalArgumentException - If sTableName is not one of { k_bugs, k_newsmsgs, k_mime_msgs } throws: NoSuchFieldException - If luceneindex property is not found at oProps throws: IllegalAccessException - throws: IOException - throws: NullPointerException - If sGuid is null |
rebuild | public static void rebuild(Properties oProps, String sTableName, String sWorkArea) throws SQLException, IOException, ClassNotFoundException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException, InstantiationException(Code) | | Rebuild Full Text Index for a table
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.
Parameters: 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 name Parameters: sWorkArea - GUID of WorkArea to be rebuilt throws: NoSuchFieldException - If any of the requiered properties of oProps is not found throws: ClassNotFoundException - If JDBC driver or analyzer classes are not found throws: SQLException - throws: IOException - throws: IllegalArgumentException - throws: IllegalAccessException - throws: InstantiationException - |
|
|