public class

DefaultSharedEntityIndexer

extends Object
implements SharedEntityIndexer
java.lang.Object
   ↳ com.atlassian.jira.sharing.index.DefaultSharedEntityIndexer

Class Overview

default implementation

Summary

Nested Classes
interface DefaultSharedEntityIndexer.EntityDocument Holds a Document and an identifying Term so we can delete any pre-existing document. 
interface DefaultSharedEntityIndexer.EntityDocumentFactory  
Public Constructors
DefaultSharedEntityIndexer(IndexPathManager indexPathManager, ShareTypeFactory shareTypeFactory, SharedEntitySearchContextToQueryFactoryMap searchContextToQueryFactoryMap, SharedEntityAccessor.Factory accessorFactory, DirectoryFactory directoryFactory, UserManager userManager, ReplicatedIndexManager replicatedIndexManager, ApplicationProperties applicationProperties)
Public Methods
String clear(TypeDescriptor<?> type)
Clear a particular type's index.
Index.Result deIndex(Set<SharedEntity> sharedEntities, boolean updateReplicatedIndex)
Delete multiple documents in the index
Index.Result deIndex(SharedEntity entity)
Delete a document from the index.
Collection<String> getAllIndexPaths()
<S extends SharedEntity> SharedEntitySearcher<S> getSearcher(TypeDescriptor<S> type)
Get a SharedEntitySearcher for the specified SharedEntity.TypeDescriptor
Index.Result index(SharedEntity entity)
Add or update a document in the index.
Index.Result index(Set<SharedEntity> sharedEntities, boolean updateReplicatedIndex)
Add or update multiple documents in the index
Index.Result index(SharedEntity entity, boolean updateReplicatedIndex)
Add or update a document in the index.
long optimize(TypeDescriptor<?> type)
Optimize a particular type's index.
void recreate(TypeDescriptor<?> type)
Recreate the index.
void shutdown(TypeDescriptor<?> type)
Shutdown a particular type's index.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.sharing.index.SharedEntityIndexer

Public Constructors

public DefaultSharedEntityIndexer (IndexPathManager indexPathManager, ShareTypeFactory shareTypeFactory, SharedEntitySearchContextToQueryFactoryMap searchContextToQueryFactoryMap, SharedEntityAccessor.Factory accessorFactory, DirectoryFactory directoryFactory, UserManager userManager, ReplicatedIndexManager replicatedIndexManager, ApplicationProperties applicationProperties)

Public Methods

public String clear (TypeDescriptor<?> type)

Clear a particular type's index. Return the path.

Parameters
type describes the particular index

public Index.Result deIndex (Set<SharedEntity> sharedEntities, boolean updateReplicatedIndex)

Delete multiple documents in the index

Parameters
sharedEntities a Set of entities to remove from the index
updateReplicatedIndex whether to update the replicated index or not

public Index.Result deIndex (SharedEntity entity)

Delete a document from the index.

Parameters
entity the entity to remove from the index

public Collection<String> getAllIndexPaths ()

public SharedEntitySearcher<S> getSearcher (TypeDescriptor<S> type)

Get a SharedEntitySearcher for the specified SharedEntity.TypeDescriptor

Parameters
type the index to use when searching
Returns
  • searcher for searching

public Index.Result index (SharedEntity entity)

Add or update a document in the index.

Parameters
entity the entity to add to the index

public Index.Result index (Set<SharedEntity> sharedEntities, boolean updateReplicatedIndex)

Add or update multiple documents in the index

Parameters
sharedEntities a Set of entities to add to the index
updateReplicatedIndex whether to update the replicated index or not

public Index.Result index (SharedEntity entity, boolean updateReplicatedIndex)

Add or update a document in the index.

Parameters
entity the entity to add to the index
updateReplicatedIndex whether to update the replicated index or not

public long optimize (TypeDescriptor<?> type)

Optimize a particular type's index.

Parameters
type describes the particular index
Returns
  • the number of milliseconds taken to optimize

public void recreate (TypeDescriptor<?> type)

Recreate the index. Clear it if it currently exists, create a new one if it doesn't.

public void shutdown (TypeDescriptor<?> type)

Shutdown a particular type's index.

Parameters
type describes the particular index