public static interface

Index.Manager

implements Closeable
com.atlassian.jira.index.Index.Manager

Class Overview

Management of an Index

Summary

[Expand]
Inherited Fields
From interface com.atlassian.jira.util.Closeable
Public Methods
void deleteIndexDirectory()
Clean out the underlying directory the index is contained in.
@Nonnull Index getIndex()
Get the current IndexConnection this manager holds.
boolean isIndexCreated()
Returns true if the index has been created.
@Nonnull IndexSearcher openSearcher()
Get the current IndexSearcher from the Index.
[Expand]
Inherited Methods
From interface com.atlassian.jira.util.Closeable
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Public Methods

public void deleteIndexDirectory ()

Clean out the underlying directory the index is contained in.

Blow away any indexes that currently live there.

@Nonnull public Index getIndex ()

Get the current IndexConnection this manager holds. May throw exceptions if the index has not been created.

Returns
  • the Index this manager refers to
Throws
IllegalStateException if the index directory is not created etc.

public boolean isIndexCreated ()

Returns true if the index has been created. This means that the index directory itself exists AND has been initialised with the default required index files.

Returns
  • true if the index exists, false otherwise.

@Nonnull public IndexSearcher openSearcher ()

Get the current IndexSearcher from the Index.

You must call the close method in a finally block once the searcher is no longer needed.

Returns