public interface IndexingContext
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INDEX_CHAIN_ID
An id that defines the current incremental chain.
|
static java.lang.String |
INDEX_CHUNK_COUNTER
A counter used to id the chunks
|
static java.lang.String |
INDEX_CHUNK_PREFIX
A prefix used to specify an incremental update chunk name
|
static java.lang.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 java.lang.String |
INDEX_ID
A property name used to specify index id
|
static java.lang.String |
INDEX_LEGACY_TIMESTAMP
A property name used to specify legacy index timestamp (the last update time)
|
static java.lang.String |
INDEX_PACKER_PROPERTIES_FILE |
static java.lang.String |
INDEX_PROPERTY_PREFIX
A prefix used for all index property names
|
static java.lang.String |
INDEX_REMOTE_PROPERTIES_FILE |
static java.lang.String |
INDEX_TIME_DAY_FORMAT
A date format used for incremental update chunk names
|
static java.lang.String |
INDEX_TIME_FORMAT
A date format used for index timestamp
|
static java.lang.String |
INDEX_TIMESTAMP
A property name used to specify index timtestamp
|
static java.lang.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.
|
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.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 |
isReceivingUpdates()
Returns true if this context is receiving updates from remote via IndexUpdater.
|
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 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,
java.util.Set<java.lang.String> allGroups,
java.util.Set<java.lang.String> rootGroups) |
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) |
static final java.lang.String INDEX_FILE_PREFIX
static final java.lang.String INDEX_REMOTE_PROPERTIES_FILE
static final java.lang.String INDEX_UPDATER_PROPERTIES_FILE
static final java.lang.String INDEX_PACKER_PROPERTIES_FILE
static final java.lang.String INDEX_PROPERTY_PREFIX
static final java.lang.String INDEX_ID
static final java.lang.String INDEX_LEGACY_TIMESTAMP
static final java.lang.String INDEX_TIMESTAMP
static final java.lang.String INDEX_CHUNK_PREFIX
static final java.lang.String INDEX_TIME_FORMAT
static final java.lang.String INDEX_TIME_DAY_FORMAT
static final java.lang.String INDEX_CHUNK_COUNTER
static final java.lang.String INDEX_CHAIN_ID
java.lang.String getId()
java.lang.String getRepositoryId()
java.io.File getRepository()
java.lang.String getRepositoryUrl()
java.lang.String getIndexUpdateUrl()
boolean isSearchable()
void setSearchable(boolean searchable)
searchable
- java.util.Date getTimestamp()
void updateTimestamp() throws java.io.IOException
java.io.IOException
void updateTimestamp(boolean save) throws java.io.IOException
java.io.IOException
void updateTimestamp(boolean save, java.util.Date date) throws java.io.IOException
java.io.IOException
int getSize() throws java.io.IOException
java.io.IOException
org.apache.lucene.search.IndexSearcher acquireIndexSearcher() throws java.io.IOException
IndexSearcher
. You have to release the received instance with
releaseIndexSearcher(IndexSearcher)
otherwise you are about to introduce leak.java.io.IOException
void releaseIndexSearcher(org.apache.lucene.search.IndexSearcher s) throws java.io.IOException
IndexSearcher
instance.s
- java.io.IOException
org.apache.lucene.index.IndexWriter getIndexWriter() throws java.io.IOException
java.io.IOException
java.util.List<IndexCreator> getIndexCreators()
org.apache.lucene.analysis.Analyzer getAnalyzer()
void commit() throws java.io.IOException
java.io.IOException
void rollback() throws java.io.IOException
java.io.IOException
void optimize() throws java.io.IOException
java.io.IOException
void close(boolean deleteFiles) throws java.io.IOException
java.io.IOException
void purge() throws java.io.IOException
java.io.IOException
void merge(org.apache.lucene.store.Directory directory) throws java.io.IOException
directory
- - the directory to mergejava.io.IOException
void merge(org.apache.lucene.store.Directory directory, DocumentFilter filter) throws java.io.IOException
directory
- - the directory to mergejava.io.IOException
void replace(org.apache.lucene.store.Directory directory) throws java.io.IOException
directory
- java.io.IOException
void replace(org.apache.lucene.store.Directory directory, java.util.Set<java.lang.String> allGroups, java.util.Set<java.lang.String> rootGroups) throws java.io.IOException
java.io.IOException
org.apache.lucene.store.Directory getIndexDirectory()
java.io.File getIndexDirectoryFile()
GavCalculator getGavCalculator()
void setAllGroups(java.util.Collection<java.lang.String> groups) throws java.io.IOException
java.io.IOException
java.util.Set<java.lang.String> getAllGroups() throws java.io.IOException
java.io.IOException
void setRootGroups(java.util.Collection<java.lang.String> groups) throws java.io.IOException
java.io.IOException
java.util.Set<java.lang.String> getRootGroups() throws java.io.IOException
java.io.IOException
void rebuildGroups() throws java.io.IOException
java.io.IOException
boolean isReceivingUpdates()