com.atlassian.jira.index
Interface Index.Manager

All Superinterfaces:
Closeable
Enclosing interface:
Index

public static interface Index.Manager
extends Closeable

Management of an Index


Field Summary
 
Fields inherited from interface com.atlassian.jira.util.Closeable
CLOSE
 
Method Summary
 void deleteIndexDirectory()
          Clean out the underlying directory the index is contained in.
 Index getIndex()
          Get the current IndexConnection this manager holds.
 boolean isIndexCreated()
          Returns true if the index has been created.
 org.apache.lucene.search.IndexSearcher openSearcher()
          Get the current IndexSearcher from the Index.
 
Methods inherited from interface com.atlassian.jira.util.Closeable
close
 

Method Detail

getIndex

@Nonnull
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.

openSearcher

@Nonnull
org.apache.lucene.search.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:
the current IndexSearcher

isIndexCreated

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.

deleteIndexDirectory

void deleteIndexDirectory()
Clean out the underlying directory the index is contained in.

Blow away any indexes that currently live there.



Copyright © 2002-2014 Atlassian. All Rights Reserved.