org.mycore.backend.lucene
Class MCRLuceneTools
java.lang.Object
org.mycore.backend.lucene.MCRLuceneTools
public class MCRLuceneTools
- extends Object
Use Lucene Analyzer to normalize strings
- Version:
- $Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
- Author:
- Harald Richter
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
config
MCRConfiguration config
MCRLuceneTools
public MCRLuceneTools()
luceneNormalize
public static String luceneNormalize(String value,
String ID)
throws Exception
- Use Lucene Analyzer to normalize strings
- Parameters:
value - string to convertID - The classes that do the normalization come from the lucene package
and are configured by the property
MCR.Lucene.Analyzer..Class in mycore.properties.
- Returns:
- the normalized string
- Throws:
Exception
getLuceneWriter
public static org.apache.lucene.index.IndexWriter getLuceneWriter(String indexDir,
boolean first)
throws Exception
- Get Lucene Writer
- Parameters:
indexDir - directory where lucene index is store first check existance of
index directory, if it does nor exist create it
- Returns:
- the lucene writer, calling programm must close writer
- Throws:
Exception
deleteLuceneDocument
public static void deleteLuceneDocument(String fieldname,
String id,
String indexDir)
throws Exception
- Delete all documents in Lucene with id
- Parameters:
fieldname - string name of lucene field with stored idid - string document idindexDir - *
the directory where index is stored
- Throws:
Exception