public class MergedIndexingContext extends AbstractIndexingContext
| Modifier and Type | Field and Description |
|---|---|
private org.apache.lucene.store.Directory |
directory |
private java.io.File |
directoryFile |
private GavCalculator |
gavCalculator |
private java.lang.String |
id |
private ContextMemberProvider |
membersProvider |
private java.io.File |
repository |
private java.lang.String |
repositoryId |
private boolean |
searchable |
INDEX_CHAIN_ID, INDEX_CHUNK_COUNTER, INDEX_CHUNK_PREFIX, INDEX_FILE_PREFIX, INDEX_ID, INDEX_LEGACY_TIMESTAMP, INDEX_PACKER_PROPERTIES_FILE, INDEX_PROPERTY_PREFIX, INDEX_REMOTE_PROPERTIES_FILE, INDEX_TIME_DAY_FORMAT, INDEX_TIME_FORMAT, INDEX_TIMESTAMP, INDEX_UPDATER_PROPERTIES_FILE| Modifier | Constructor and Description |
|---|---|
private |
MergedIndexingContext(ContextMemberProvider membersProvider,
java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
org.apache.lucene.store.Directory indexDirectory,
boolean searchable) |
|
MergedIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
org.apache.lucene.store.Directory indexDirectory,
boolean searchable,
ContextMemberProvider membersProvider)
Deprecated.
|
|
MergedIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
java.io.File indexDirectoryFile,
boolean searchable,
ContextMemberProvider membersProvider) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.lucene.search.IndexSearcher |
acquireIndexSearcher()
Acquires a fresh instance of
IndexSearcher. |
void |
close(boolean deleteFiles)
Shuts down this context.
|
void |
commit()
Commits changes to context, eventually refreshing readers/searchers too.
|
java.util.Set<java.lang.String> |
getAllGroups()
Gets all group names stored in the current indexing context
|
org.apache.lucene.analysis.Analyzer |
getAnalyzer()
Returns the Lucene Analyzer of this context used for by IndexWriter and IndexSearcher.
|
GavCalculator |
getGavCalculator()
Returns the GavCalculator for this Context.
|
java.lang.String |
getId()
Returns this indexing context id.
|
java.util.List<IndexCreator> |
getIndexCreators()
List of IndexCreators used in this context.
|
org.apache.lucene.store.Directory |
getIndexDirectory() |
java.io.File |
getIndexDirectoryFile() |
java.lang.String |
getIndexUpdateUrl()
Returns url for the index update
|
org.apache.lucene.index.IndexWriter |
getIndexWriter()
Returns the Lucene IndexWriter (thread safe, shared instance) of this context.
|
java.util.Collection<IndexingContext> |
getMembers() |
java.io.File |
getRepository()
Returns location for the local repository.
|
java.lang.String |
getRepositoryId()
Returns repository id.
|
java.lang.String |
getRepositoryUrl()
Returns public repository url.
|
java.util.Set<java.lang.String> |
getRootGroups()
Gets root group names stored in the current indexing context
|
int |
getSize()
Returns a number that represents the "size" useful for doing comparisons between contexts (which one has more
data indexed?).
|
java.util.Date |
getTimestamp()
Returns index update time
|
boolean |
isSearchable()
Is the context searchable when doing "non-targeted" searches? Ie.
|
void |
merge(org.apache.lucene.store.Directory directory)
Merges content of given Lucene directory with this context.
|
void |
merge(org.apache.lucene.store.Directory directory,
DocumentFilter filter)
Merges content of given Lucene directory with this context, but filters out the unwanted ones.
|
void |
optimize()
Optimizes index.
|
void |
purge()
Purge (cleans) the context, deletes/empties the index and restores the context to new/empty state.
|
void |
rebuildGroups()
Rebuilds stored group names from the index
|
void |
releaseIndexSearcher(org.apache.lucene.search.IndexSearcher indexSearcher)
Releases the
IndexSearcher instance. |
void |
replace(org.apache.lucene.store.Directory directory)
Replaces the Lucene index with the one from supplied directory.
|
void |
rollback()
Rolls back changes to context, eventually refreshing readers/searchers too.
|
void |
setAllGroups(java.util.Collection<java.lang.String> groups)
Sets all group names stored in the current indexing context
|
void |
setRootGroups(java.util.Collection<java.lang.String> groups)
Sets root group names stored in the current indexing context
|
void |
setSearchable(boolean searchable)
Sets is the context searchable when doing "non-targeted" searches.
|
void |
updateTimestamp() |
void |
updateTimestamp(boolean save) |
void |
updateTimestamp(boolean save,
java.util.Date date) |
isReceivingUpdatesprivate final java.lang.String id
private final java.lang.String repositoryId
private final java.io.File repository
private final ContextMemberProvider membersProvider
private final GavCalculator gavCalculator
private final org.apache.lucene.store.Directory directory
private java.io.File directoryFile
private boolean searchable
private MergedIndexingContext(ContextMemberProvider membersProvider, java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable) throws java.io.IOException
java.io.IOExceptionpublic MergedIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
java.io.File indexDirectoryFile,
boolean searchable,
ContextMemberProvider membersProvider)
throws java.io.IOException
java.io.IOException@Deprecated
public MergedIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
org.apache.lucene.store.Directory indexDirectory,
boolean searchable,
ContextMemberProvider membersProvider)
throws java.io.IOException
java.io.IOExceptionpublic java.util.Collection<IndexingContext> getMembers()
public java.lang.String getId()
IndexingContextpublic java.lang.String getRepositoryId()
IndexingContextpublic java.io.File getRepository()
IndexingContextpublic java.lang.String getRepositoryUrl()
IndexingContextpublic java.lang.String getIndexUpdateUrl()
IndexingContextpublic boolean isSearchable()
IndexingContextpublic void setSearchable(boolean searchable)
IndexingContextpublic java.util.Date getTimestamp()
IndexingContextpublic void updateTimestamp()
throws java.io.IOException
java.io.IOExceptionpublic void updateTimestamp(boolean save)
throws java.io.IOException
java.io.IOExceptionpublic void updateTimestamp(boolean save,
java.util.Date date)
throws java.io.IOException
java.io.IOExceptionpublic int getSize()
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic org.apache.lucene.search.IndexSearcher acquireIndexSearcher()
throws java.io.IOException
IndexingContextIndexSearcher. You have to release the received instance with
IndexingContext.releaseIndexSearcher(IndexSearcher) otherwise you are about to introduce leak.java.io.IOExceptionpublic void releaseIndexSearcher(org.apache.lucene.search.IndexSearcher indexSearcher)
throws java.io.IOException
IndexingContextIndexSearcher instance.java.io.IOExceptionpublic org.apache.lucene.index.IndexWriter getIndexWriter()
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic java.util.List<IndexCreator> getIndexCreators()
IndexingContextpublic org.apache.lucene.analysis.Analyzer getAnalyzer()
IndexingContextpublic void commit()
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic void rollback()
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic void optimize()
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic void close(boolean deleteFiles)
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic void purge()
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic void merge(org.apache.lucene.store.Directory directory)
throws java.io.IOException
IndexingContextdirectory - - the directory to mergejava.io.IOExceptionpublic void merge(org.apache.lucene.store.Directory directory,
DocumentFilter filter)
throws java.io.IOException
IndexingContextdirectory - - the directory to mergejava.io.IOExceptionpublic void replace(org.apache.lucene.store.Directory directory)
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic org.apache.lucene.store.Directory getIndexDirectory()
public java.io.File getIndexDirectoryFile()
public GavCalculator getGavCalculator()
IndexingContextpublic void setAllGroups(java.util.Collection<java.lang.String> groups)
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic java.util.Set<java.lang.String> getAllGroups()
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic void setRootGroups(java.util.Collection<java.lang.String> groups)
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic java.util.Set<java.lang.String> getRootGroups()
throws java.io.IOException
IndexingContextjava.io.IOExceptionpublic void rebuildGroups()
throws java.io.IOException
IndexingContextjava.io.IOException