|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.structures.Index
public class Index
This class encapsulates all the Indexes at retrieval time. It is loaded by giving a path and prefix. This looks for an index properties file at path/prefix.properties. Essentially, the properties file then specifies which index structures the index supports. The index then loads these so they can be used in retrieval.
Arbitrary properties can be defined in the index properties files, and in particular, properties are used to record index statistics and the contructor type and values of various index objects. Properties defaults are chosen appropriately for Terrier 1.x indices.
The Index will apply methods on specially marked interfaces. Currently, these are LegacyBitFileStructure and IndexConfigurable. Moreover, structures implementing Closeable will have their close method called when the Index is closed.
Method Summary | |
---|---|
void |
addIndexStructure(java.lang.String structureName,
java.lang.String className)
add an index structure to this index. |
void |
addIndexStructure(java.lang.String structureName,
java.lang.String className,
java.lang.String[] paramTypes,
java.lang.String[] paramValues)
add an index structure to this index. |
void |
addIndexStructure(java.lang.String structureName,
java.lang.String className,
java.lang.String paramTypes,
java.lang.String paramValues)
add an index structure to this index. |
void |
addIndexStructureInputStream(java.lang.String structureName,
java.lang.String className)
tell the index about a new input stream index structure it provides. |
void |
addIndexStructureInputStream(java.lang.String structureName,
java.lang.String className,
java.lang.String[] paramTypes,
java.lang.String[] paramValues)
tell the index about a new input stream index structure it provides. |
void |
addIndexStructureInputStream(java.lang.String structureName,
java.lang.String className,
java.lang.String paramTypes,
java.lang.String paramValues)
tell the index about a new input stream index structure it provides. |
void |
close()
Closes the data structures of the index. |
static Index |
createIndex()
Factory method for creating an index. |
static Index |
createIndex(java.lang.String path,
java.lang.String prefix)
Factory method for load an index. |
static Index |
createNewIndex(java.lang.String path,
java.lang.String prefix)
Factory method create a new index. |
static boolean |
existsIndex(java.lang.String path,
java.lang.String prefix)
Returns true if it is likely that an index exists at the specified location |
void |
flush()
Write any dirty data structures down to disk |
CollectionStatistics |
getCollectionStatistics()
|
DirectIndex |
getDirectIndex()
Return the DirectIndex associated with this index |
DocumentIndex |
getDocumentIndex()
Return the DocumentIndex associated with this index |
java.lang.String |
getIndexProperty(java.lang.String key,
java.lang.String defaultValue)
get an arbitrary property in the index |
java.lang.Object |
getIndexStructure(java.lang.String structureName)
Obtains the named index structure, using an already loaded one if possible. |
java.lang.Object |
getIndexStructureInputStream(java.lang.String structureName)
Return the input stream associated with the specified structure of this index |
int |
getIntIndexProperty(java.lang.String key,
int defaultValue)
get an arbitrary int property from the index |
InvertedIndex |
getInvertedIndex()
Returns the InvertedIndex to use for this index |
static java.lang.String |
getLastIndexLoadError()
Returns the last warning given by an index being loaded. |
Lexicon |
getLexicon()
Return the Lexicon associated with this index |
java.lang.String |
getPath()
Returns the path of this index |
java.lang.String |
getPrefix()
Returns the prefix of this index |
boolean |
hasIndexStructure(java.lang.String structureName)
Does this index have an index structure with the specified name? |
boolean |
hasIndexStructureInputStream(java.lang.String structureName)
Does this index have an index structure input stream with the specified name? |
void |
setIndexProperty(java.lang.String key,
java.lang.String value)
set an arbitrary property in the index |
java.lang.String |
toString()
Returns a String representation of this index |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public boolean hasIndexStructure(java.lang.String structureName)
structureName
- name of the required structure
public boolean hasIndexStructureInputStream(java.lang.String structureName)
structureName
- name of the required structure
public java.lang.Object getIndexStructure(java.lang.String structureName)
structureName
- name of the required structure
public java.lang.Object getIndexStructureInputStream(java.lang.String structureName)
structureName
- The name of the structure of which you want the inputstream. Eg "lexicon"
public void close()
close
in interface Closeable
public void flush()
public InvertedIndex getInvertedIndex()
public DirectIndex getDirectIndex()
public Lexicon getLexicon()
public DocumentIndex getDocumentIndex()
public CollectionStatistics getCollectionStatistics()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getPath()
public java.lang.String getPrefix()
public void addIndexStructure(java.lang.String structureName, java.lang.String className)
structureName
- className
- public void addIndexStructure(java.lang.String structureName, java.lang.String className, java.lang.String[] paramTypes, java.lang.String[] paramValues)
public void addIndexStructure(java.lang.String structureName, java.lang.String className, java.lang.String paramTypes, java.lang.String paramValues)
public void addIndexStructureInputStream(java.lang.String structureName, java.lang.String className)
public void addIndexStructureInputStream(java.lang.String structureName, java.lang.String className, java.lang.String[] paramTypes, java.lang.String[] paramValues)
public void addIndexStructureInputStream(java.lang.String structureName, java.lang.String className, java.lang.String paramTypes, java.lang.String paramValues)
public void setIndexProperty(java.lang.String key, java.lang.String value)
key
- Key to of the property to setvalue
- Value of the property to setpublic java.lang.String getIndexProperty(java.lang.String key, java.lang.String defaultValue)
key
- Key of the property to getdefaultValue
- value of the property to use if property is not set
public int getIntIndexProperty(java.lang.String key, int defaultValue)
public static Index createIndex(java.lang.String path, java.lang.String prefix)
path
- String the path in which the
data structures will be created.prefix
- String the prefix of the files
to be created.public static Index createNewIndex(java.lang.String path, java.lang.String prefix)
path
- String the path in which the
data structures will be created.prefix
- String the prefix of the files
to be created.public static java.lang.String getLastIndexLoadError()
public static boolean existsIndex(java.lang.String path, java.lang.String prefix)
path
- prefix
-
public static Index createIndex()
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |