com.atlassian.jira.util
Class LuceneUtils
java.lang.Object
com.atlassian.jira.util.LuceneUtils
- public class LuceneUtils
- extends Object
A simple utility class for our common Lucene usage methods.
Method Summary |
static org.apache.lucene.index.IndexReader |
getIndexReader(String path)
|
static org.apache.lucene.index.IndexWriter |
getIndexWriter(String path,
boolean create,
org.apache.lucene.analysis.Analyzer analyzer)
|
static com.atlassian.bonnie.ILuceneConnection |
getLuceneConnection(String path,
boolean create,
org.apache.lucene.analysis.Analyzer analyzer,
com.atlassian.bonnie.ILuceneConnection.Configuration configuration)
|
static Collection |
getStaleLockPaths(Collection indexDirectoryPaths)
Given a Collection of paths that represent index directories checks if there are any existing
Lucene lock files for the passed paths. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getIndexReader
public static org.apache.lucene.index.IndexReader getIndexReader(String path)
throws IndexException
- Throws:
IndexException
getIndexWriter
public static org.apache.lucene.index.IndexWriter getIndexWriter(String path,
boolean create,
org.apache.lucene.analysis.Analyzer analyzer)
throws IndexException
- Throws:
IndexException
getLuceneConnection
public static com.atlassian.bonnie.ILuceneConnection getLuceneConnection(String path,
boolean create,
org.apache.lucene.analysis.Analyzer analyzer,
com.atlassian.bonnie.ILuceneConnection.Configuration configuration)
throws IndexException
- Throws:
IndexException
getStaleLockPaths
public static Collection getStaleLockPaths(Collection indexDirectoryPaths)
- Given a
Collection
of paths that represent index directories checks if there are any existing
Lucene lock files for the passed paths. This method returns a Collection
of file paths of any existing
Lucene lock files. If no lock files are found an empty collection is returned.
A common usage of this methdo would be:
Collection existingLockFilepaths = LuceneUtils.getStaleLockPaths(indexManager.getAllIndexPaths());
Copyright © 2002-2007 Atlassian. All Rights Reserved.