public interface IndexingContext
| Modifier and Type | Field and Description |
|---|---|
static String |
INDEX_CHAIN_ID
An id that defines the current incremental chain.
|
static String |
INDEX_CHUNK_COUNTER
A counter used to id the chunks
|
static String |
INDEX_CHUNK_PREFIX
A prefix used to specify an incremental update chunk name
|
static String |
INDEX_FILE_PREFIX
Standard name of the full repository index that is used when clients requesting index information have nothing to
start with.
|
static String |
INDEX_ID
A property name used to specify index id
|
static String |
INDEX_LEGACY_TIMESTAMP
A property name used to specify legacy index timestamp (the last update time)
|
static String |
INDEX_PACKER_PROPERTIES_FILE |
static String |
INDEX_PROPERTY_PREFIX
A prefix used for all index property names
|
static String |
INDEX_REMOTE_PROPERTIES_FILE |
static String |
INDEX_TIME_DAY_FORMAT
A date format used for incremental update chunk names
|
static String |
INDEX_TIME_FORMAT
A date format used for index timestamp
|
static String |
INDEX_TIMESTAMP
A property name used to specify index timtestamp
|
static String |
INDEX_UPDATER_PROPERTIES_FILE |
| 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.
|
Set<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.
|
String |
getId()
Returns this indexing context id.
|
List<IndexCreator> |
getIndexCreators()
List of IndexCreators used in this context.
|
org.apache.lucene.store.Directory |
getIndexDirectory() |
File |
getIndexDirectoryFile() |
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.
|
File |
getRepository()
Returns location for the local repository.
|
String |
getRepositoryId()
Returns repository id.
|
String |
getRepositoryUrl()
Returns public repository url.
|
Set<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?).
|
Date |
getTimestamp()
Returns index update time
|
boolean |
isReceivingUpdates()
Returns true if this context is receiving updates from remote via IndexUpdater.
|
boolean |
isSearchable()
Is the context searchable when doing "non-targeted" searches?
|
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 s)
Releases the
IndexSearcher instance. |
void |
replace(org.apache.lucene.store.Directory directory)
Replaces the Lucene index with the one from supplied directory.
|
void |
replace(org.apache.lucene.store.Directory directory,
Set<String> allGroups,
Set<String> rootGroups) |
void |
rollback()
Rolls back changes to context, eventually refreshing readers/searchers too.
|
void |
setAllGroups(Collection<String> groups)
Sets all group names stored in the current indexing context
|
void |
setRootGroups(Collection<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,
Date date) |
static final String INDEX_FILE_PREFIX
static final String INDEX_REMOTE_PROPERTIES_FILE
static final String INDEX_UPDATER_PROPERTIES_FILE
static final String INDEX_PACKER_PROPERTIES_FILE
static final String INDEX_PROPERTY_PREFIX
static final String INDEX_ID
static final String INDEX_LEGACY_TIMESTAMP
static final String INDEX_TIMESTAMP
static final String INDEX_CHUNK_PREFIX
static final String INDEX_TIME_FORMAT
static final String INDEX_TIME_DAY_FORMAT
static final String INDEX_CHUNK_COUNTER
static final String INDEX_CHAIN_ID
String getId()
String getRepositoryId()
File getRepository()
String getRepositoryUrl()
String getIndexUpdateUrl()
boolean isSearchable()
void setSearchable(boolean searchable)
searchable - Date getTimestamp()
void updateTimestamp()
throws IOException
IOExceptionvoid updateTimestamp(boolean save)
throws IOException
IOExceptionvoid updateTimestamp(boolean save,
Date date)
throws IOException
IOExceptionint getSize()
throws IOException
IOExceptionorg.apache.lucene.search.IndexSearcher acquireIndexSearcher()
throws IOException
IndexSearcher. You have to release the received instance with
releaseIndexSearcher(IndexSearcher) otherwise you are about to introduce leak.IOExceptionvoid releaseIndexSearcher(org.apache.lucene.search.IndexSearcher s)
throws IOException
IndexSearcher instance.s - IOExceptionorg.apache.lucene.index.IndexWriter getIndexWriter()
throws IOException
IOExceptionList<IndexCreator> getIndexCreators()
org.apache.lucene.analysis.Analyzer getAnalyzer()
void commit()
throws IOException
IOExceptionvoid rollback()
throws IOException
IOExceptionvoid optimize()
throws IOException
IOExceptionvoid close(boolean deleteFiles)
throws IOException
IOExceptionvoid purge()
throws IOException
IOExceptionvoid merge(org.apache.lucene.store.Directory directory)
throws IOException
directory - - the directory to mergeIOExceptionvoid merge(org.apache.lucene.store.Directory directory,
DocumentFilter filter)
throws IOException
directory - - the directory to mergeIOExceptionvoid replace(org.apache.lucene.store.Directory directory)
throws IOException
directory - IOExceptionvoid replace(org.apache.lucene.store.Directory directory,
Set<String> allGroups,
Set<String> rootGroups)
throws IOException
IOExceptionorg.apache.lucene.store.Directory getIndexDirectory()
File getIndexDirectoryFile()
GavCalculator getGavCalculator()
void setAllGroups(Collection<String> groups) throws IOException
IOExceptionSet<String> getAllGroups() throws IOException
IOExceptionvoid setRootGroups(Collection<String> groups) throws IOException
IOExceptionSet<String> getRootGroups() throws IOException
IOExceptionvoid rebuildGroups()
throws IOException
IOExceptionboolean isReceivingUpdates()
Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.