public class IndexOnDisk extends Index
Index.UpdatingCollectionStatistics
Modifier and Type | Field and Description |
---|---|
protected String |
loadError |
protected boolean |
loadSuccess
Set to true if loading an index succeeds
|
protected String |
path
path component of this index's location
|
protected String |
prefix
prefix component of this index's location
|
protected HashMap<String,Object> |
structureCache
Cache of all opened index structures, but not input streams
|
dirtyProperties, EMPTY_CLASS_ARRAY, lastLoadError, logger, MINIMUM_INDEX_TERRIER_VERSION, properties, PROPERTIES_SUFFIX, RETRIEVAL_LOADING_PROFILE
Modifier | Constructor and Description |
---|---|
protected |
IndexOnDisk()
A default constructor that creates an instance of the index.
|
|
IndexOnDisk(long l,
long m,
long n) |
protected |
IndexOnDisk(String _path,
String _prefix,
boolean isNew)
Constructs a new Index object.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the data structures of the index.
|
void |
flush()
Write any dirty data structures down to disk
|
protected void |
flushProperties()
Write any dirty properties down to disk
|
CollectionStatistics |
getCollectionStatistics()
Get the collection statistics
|
PostingIndex<Pointer> |
getDirectIndex()
Return the DirectIndex associated with this index
|
DocumentIndex |
getDocumentIndex()
Return the DocumentIndex associated with this index
|
Object |
getIndexStructure(String structureName)
Obtains the named index structure, using an already loaded one if
possible.
|
Object |
getIndexStructureInputStream(String structureName)
Return the input stream associated with the specified structure of this
index
|
PostingIndex<?> |
getInvertedIndex()
Returns the InvertedIndex to use for this index
|
Lexicon<String> |
getLexicon()
Return the Lexicon associated with this index
|
MetaIndex |
getMetaIndex()
Get the Meta Index structure
|
String |
getPath()
Returns the path of this index
|
String |
getPrefix()
Returns the prefix of this index
|
protected Object |
loadIndexStructure(String structureName)
Load a new instance of the named index structure.
|
protected void |
loadIndices()
load all index structures.
|
protected boolean |
loadProperties()
loads in the properties file, falling back to the Terrier 1.xx log file
if no properties exist.
|
protected void |
loadStatistics()
for an immutable index, use a normal collection statistics, never changes
|
protected void |
loadUpdatingStatistics()
for an index that is not yet built, use an UpdatingCollectionStatistics,
which is slower but can support updates of the index statistics
|
String |
toString()
Returns a String representation of this index
|
addIndexStructure, addIndexStructure, addIndexStructure, addIndexStructure, addIndexStructureInputStream, addIndexStructureInputStream, addIndexStructureInputStream, addIndexStructureInputStream, allExists, createIndex, createIndex, createNewIndex, existsIndex, getEnd, getIndexLoadingProfileAsRetrieval, getIndexProperty, getIntIndexProperty, getLastIndexLoadError, getProperties, getStart, hasIndexStructure, hasIndexStructureInputStream, join, main, setIndexLoadingProfileAsRetrieval, setIndexProperty
protected String path
protected String prefix
protected final HashMap<String,Object> structureCache
protected boolean loadSuccess
protected String loadError
protected IndexOnDisk()
protected IndexOnDisk(String _path, String _prefix, boolean isNew)
_path
- String the path in which the data structures will be created._prefix
- String the prefix of the files to be created.isNew
- where a new Index should be created if there is no index at
the specified locationpublic IndexOnDisk(long l, long m, long n)
public void close() throws IOException
Index
close
in interface Closeable
close
in interface AutoCloseable
close
in class Index
IOException
public void flush() throws IOException
Index
flush
in interface Flushable
flush
in class Index
IOException
protected void flushProperties() throws IOException
IOException
public CollectionStatistics getCollectionStatistics()
Index
getCollectionStatistics
in class Index
public PostingIndex<Pointer> getDirectIndex()
Index
getDirectIndex
in class Index
public DocumentIndex getDocumentIndex()
Index
getDocumentIndex
in class Index
public Object getIndexStructure(String structureName)
getIndexStructure
in class Index
structureName
- name of the required structurepublic Object getIndexStructureInputStream(String structureName)
Index
getIndexStructureInputStream
in class Index
structureName
- The name of the structure of which you want the inputstream.
Eg "lexicon"public PostingIndex<?> getInvertedIndex()
Index
getInvertedIndex
in class Index
public Lexicon<String> getLexicon()
Index
getLexicon
in class Index
public MetaIndex getMetaIndex()
Index
getMetaIndex
in class Index
public String getPath()
public String getPrefix()
protected Object loadIndexStructure(String structureName)
structureName
- name of the required structureprotected void loadIndices()
protected boolean loadProperties()
protected void loadStatistics()
protected void loadUpdatingStatistics()
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow