public class LuceneUtils
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
LuceneUtils.AnalyzerType
Different types of analyzers
|
| 限定符和类型 | 字段和说明 |
|---|---|
static org.apache.lucene.util.Version |
LUCENE_VERSION
Currently employed version of Lucene
|
| 构造器和说明 |
|---|
LuceneUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
closeReader(org.apache.lucene.index.IndexReader reader) |
static void |
closeWriter(org.apache.lucene.index.IndexWriter iw) |
static void |
commitWriter(org.apache.lucene.index.IndexWriter iw) |
static org.apache.lucene.index.IndexWriter |
createIndexWriter(org.apache.lucene.store.Directory directory,
boolean create,
LuceneUtils.AnalyzerType analyzer)
Creates an IndexWriter for given index path, with given analyzer.
|
static org.apache.lucene.index.IndexWriter |
createIndexWriter(org.apache.lucene.store.Directory directory,
boolean create,
LuceneUtils.AnalyzerType analyzer,
double RAMBufferSize) |
static org.apache.lucene.index.IndexWriter |
createIndexWriter(java.lang.String indexPath,
boolean create)
Creates an IndexWriter for given index path, with a SimpleAnalyzer.
|
static org.apache.lucene.index.IndexWriter |
createIndexWriter(java.lang.String indexPath,
boolean create,
LuceneUtils.AnalyzerType analyzer)
Creates an IndexWriter for given index path, with given analyzer.
|
static byte[] |
getBytes(org.apache.lucene.util.BytesRef byteRef)
Method for 'converting' ByteRefs to bytes.
|
static org.apache.lucene.index.IndexReader |
openIndexReader(org.apache.lucene.store.FSDirectory directory) |
static org.apache.lucene.index.IndexReader |
openIndexReader(org.apache.lucene.store.FSDirectory directory,
boolean RAMDirectory) |
static org.apache.lucene.index.IndexReader |
openIndexReader(org.apache.lucene.index.IndexWriter writer,
boolean applyDeletes) |
static org.apache.lucene.index.IndexReader |
openIndexReader(java.lang.String indexPath) |
static org.apache.lucene.index.IndexReader |
openIndexReader(java.lang.String indexPath,
boolean RAMDirectory) |
static org.apache.lucene.search.IndexSearcher |
openIndexSearcher(org.apache.lucene.index.IndexReader reader) |
static void |
optimizeWriter(org.apache.lucene.index.IndexWriter iw)
Optimizes an index.
|
public static final org.apache.lucene.util.Version LUCENE_VERSION
public static org.apache.lucene.index.IndexWriter createIndexWriter(java.lang.String indexPath,
boolean create)
throws java.io.IOException
indexPath - the path to the index directorycreate - set to true if you want to create a new indexjava.io.IOExceptionpublic static org.apache.lucene.index.IndexWriter createIndexWriter(java.lang.String indexPath,
boolean create,
LuceneUtils.AnalyzerType analyzer)
throws java.io.IOException
indexPath - the path to the index directorycreate - set to true if you want to create a new indexanalyzer - gives the analyzer used for the Indexwriter.java.io.IOExceptionpublic static org.apache.lucene.index.IndexWriter createIndexWriter(org.apache.lucene.store.Directory directory,
boolean create,
LuceneUtils.AnalyzerType analyzer)
throws java.io.IOException
directory - the path to the index directorycreate - set to true if you want to create a new indexanalyzer - gives the analyzer used for the Indexwriter.java.io.IOExceptionpublic static org.apache.lucene.index.IndexWriter createIndexWriter(org.apache.lucene.store.Directory directory,
boolean create,
LuceneUtils.AnalyzerType analyzer,
double RAMBufferSize)
throws java.io.IOException
java.io.IOExceptionpublic static void optimizeWriter(org.apache.lucene.index.IndexWriter iw)
throws java.io.IOException
iw - java.io.IOExceptionpublic static void commitWriter(org.apache.lucene.index.IndexWriter iw)
throws java.io.IOException
java.io.IOExceptionpublic static void closeWriter(org.apache.lucene.index.IndexWriter iw)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.index.IndexReader openIndexReader(java.lang.String indexPath)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.index.IndexReader openIndexReader(java.lang.String indexPath,
boolean RAMDirectory)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.index.IndexReader openIndexReader(org.apache.lucene.store.FSDirectory directory)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.index.IndexReader openIndexReader(org.apache.lucene.store.FSDirectory directory,
boolean RAMDirectory)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.index.IndexReader openIndexReader(org.apache.lucene.index.IndexWriter writer,
boolean applyDeletes)
throws java.io.IOException
java.io.IOExceptionpublic static void closeReader(org.apache.lucene.index.IndexReader reader)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.search.IndexSearcher openIndexSearcher(org.apache.lucene.index.IndexReader reader)
public static byte[] getBytes(org.apache.lucene.util.BytesRef byteRef)
byteRef -