|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.index.DefaultIndexManager
public class DefaultIndexManager
Field Summary | |
---|---|
static org.apache.lucene.analysis.Analyzer |
ANALYZER_FOR_INDEXING
|
static org.apache.lucene.analysis.Analyzer |
ANALYZER_FOR_SEARCHING
|
static String |
COMMENTS_SUBDIR
|
static String |
ISSUES_SUBDIR
|
static String |
PLUGINS_SUBDIR
|
Constructor Summary | |
---|---|
DefaultIndexManager()
|
|
DefaultIndexManager(ApplicationProperties applicationProperties,
IssueIndexer issueIndexer)
|
Method Summary | |
---|---|
long |
activate(String indexPath,
com.atlassian.johnson.event.Event appEvent)
Activates search indexes. |
void |
deactivate()
Deactivates indexing (as happens from the admin page) and removes index directories. |
void |
deactivate(String filePath)
Deactivate a specific search index and remove its directory. |
void |
deIndex(org.ofbiz.core.entity.GenericValue entity)
Remove an issue from the search index. |
Collection |
getAllIndexPaths()
Returns a Collection of String s, each respesenting a path to the issue index directory, comment
index directory and all existing plugin index directories. |
org.apache.lucene.search.IndexSearcher |
getCommentSearcher()
Get an IndexSearcher that can be used to search the comment index. |
Collection |
getExistingPluginsPaths()
Returns a collection of Strings, each one representing the absolute path to the actual existing directory where a plugin keeps its indexes. |
protected String |
getFilePath()
Return the path beneath which the different index directories are stored, protected so the MemoryIndexManager can override for testing purposes. |
(package private) boolean |
getIndexLock()
this is package private as tests override it |
org.apache.lucene.search.IndexSearcher |
getIssueSearcher()
Get an IndexSearcher that can be used to search the issue index. |
String |
getPluginsRootPath()
Get the root path of the index directory for plugins. |
(package private) int |
getReindexesSinceOptimize()
Get the count of reindexes since the last call to optimize. |
boolean |
isIndexingEnabled()
Is the indexing system enabled. |
long |
optimize()
Optimize the underlying indexes. |
void |
reIndex(org.ofbiz.core.entity.GenericValue issueGV)
Reindex an issue (eg. |
void |
reIndex(Issue issue)
Reindex an issue (eg. |
long |
reIndexAll()
Reindex all issues. |
long |
reIndexAll(com.atlassian.johnson.event.Event event)
Reindex all issues. |
long |
reIndexIssueObjects(Collection issueObjects)
Reindex a set of issues. |
long |
reIndexIssues(Collection issues)
Reindex a set of issues (GenericValues). |
long |
reIndexIssues(IssuesIterable issuesIterable,
com.atlassian.johnson.event.Event event)
Reindex a list of issues, passing an optional event that will be set progress |
void |
shutdown()
Shuts down the indexing manager and closes its resources (if any). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_SEARCHING
public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_INDEXING
public static final String COMMENTS_SUBDIR
public static final String ISSUES_SUBDIR
public static final String PLUGINS_SUBDIR
Constructor Detail |
---|
public DefaultIndexManager()
public DefaultIndexManager(ApplicationProperties applicationProperties, IssueIndexer issueIndexer)
Method Detail |
---|
public void deactivate(String filePath) throws Exception
IssueIndexManager
deactivate
in interface IssueIndexManager
Exception
public void deactivate() throws Exception
IssueIndexManager
deactivate
in interface IssueIndexManager
Exception
public long activate(String indexPath, com.atlassian.johnson.event.Event appEvent) throws Exception
IssueIndexManager
activate
in interface IssueIndexManager
indexPath
- Root path to the search index.appEvent
- Optional reindex Event
that the caller has set (see source in IndexAdminImpl.doActivate()
) or null.
Exception
public boolean isIndexingEnabled()
IssueIndexManager
isIndexingEnabled
in interface IssueIndexManager
public long reIndexAll() throws IndexException
IssueIndexManager
reIndexAll
in interface IssueIndexManager
IndexException
public long reIndexAll(com.atlassian.johnson.event.Event event) throws IndexException
IssueIndexManager
reIndexAll
in interface IssueIndexManager
event
- Reindex Event
that the caller has set (see source in IndexAdminImpl.doActivate()
).
IndexException
public long reIndexIssues(Collection issues) throws IndexException
IssueIndexManager
IssueIndexManager.reIndexIssueObjects(Collection)
instead when possible.
reIndexIssues
in interface IssueIndexManager
issues
- The Issue GenericValue
s to reindex.
IndexException
public long reIndexIssueObjects(Collection issueObjects) throws IndexException
IssueIndexManager
reIndexIssueObjects
in interface IssueIndexManager
issueObjects
- Set of Issue
s to reindex.
IndexException
public void reIndex(Issue issue) throws IndexException
IssueIndexManager
reIndex
in interface IssueIndexManager
IndexException
public void reIndex(org.ofbiz.core.entity.GenericValue issueGV) throws IndexException
IssueIndexManager
reIndex
in interface IssueIndexManager
IndexException
public long reIndexIssues(IssuesIterable issuesIterable, com.atlassian.johnson.event.Event event) throws IndexException
IssueIndexManager
reIndexIssues
in interface IssueIndexManager
event
- Can be null, else progress will be sent to the event
IndexException
public long optimize() throws IndexException
IssueIndexManager
optimize
in interface IssueIndexManager
IndexException
- if the indexes are seriously in troublepublic void deIndex(org.ofbiz.core.entity.GenericValue entity) throws IndexException
IssueIndexManager
deIndex
in interface IssueIndexManager
IndexException
boolean getIndexLock()
public String getPluginsRootPath()
IssueIndexManager
getPluginsRootPath
in interface IssueIndexManager
public Collection getExistingPluginsPaths()
IssueIndexManager
IssueIndexManager.getPluginsRootPath()
.
If a plugin index root path does not exist, or is empty (no sub-directopries exist) then an empty collection will be returned.
getExistingPluginsPaths
in interface IssueIndexManager
public Collection getAllIndexPaths()
IssueIndexManager
Collection
of String
s, each respesenting a path to the issue index directory, comment
index directory and all existing plugin index directories.
getAllIndexPaths
in interface IssueIndexManager
public org.apache.lucene.search.IndexSearcher getIssueSearcher()
IssueIndexManager
IndexSearcher
that can be used to search the issue index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close()
when you are done with it.
Alternatively you should really call SearchProviderFactory#getSearcher(String))
passing in
SearchProviderFactory.ISSUE_INDEX
as it is a managed searcher and all the closing semantics are handled
for you.
getIssueSearcher
in interface IssueIndexManager
public org.apache.lucene.search.IndexSearcher getCommentSearcher()
IssueIndexManager
IndexSearcher
that can be used to search the comment index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close()
when you are done with it.
Alternatively you should really call SearchProviderFactory#getSearcher(String))
passing in
SearchProviderFactory.COMMENT_INDEX
as it is a managed searcher and all the closing semantics are handled
for you.
getCommentSearcher
in interface IssueIndexManager
public void shutdown()
IssueIndexManager
shutdown
in interface IssueIndexManager
int getReindexesSinceOptimize()
protected String getFilePath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |