Package org.terrier.realtime.multi
Class MultiIndex
- java.lang.Object
-
- org.terrier.structures.Index
-
- org.terrier.realtime.multi.MultiIndex
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
IncrementalIndex
public class MultiIndex extends Index
The central MultiIndex structure. MultiIndex is a wrapper around multiple indices such that they appear as one single index. Matching over a MultiIndex can either be performed by a normal matching across all index shards or using a special selective matching class that only uses a subset of the shards this contains.Properties
- multiindex.selectivematching - What policy should be used to perform matching. Two options are supported: all (default), mostrecent
- Since:
- 4.0
- Author:
- Richard McCreadie, Stuart Mackie
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.terrier.structures.Index
Index.DirectIndexRef
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
blocks
protected boolean
fields
protected java.util.List<Index>
indices
protected IncrementalSelectiveMatching
selectiveMatchingPolicy
Selective Matching policy, a policy for accessing only subsets of the indices within this multi-index.
-
Constructor Summary
Constructors Constructor Description MultiIndex(Index[] indices, boolean blocks, boolean fields)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
CollectionStatistics
getCollectionStatistics()
Get the collection statisticsPostingIndex<?>
getDirectIndex()
Return the DirectIndex associated with this indexDocumentIndex
getDocumentIndex()
Return the DocumentIndex associated with this indexIndexRef
getIndexRef()
Returns a direct IndexRef to this indexjava.lang.Object
getIndexStructureInputStream(java.lang.String structureName)
Not implemented.PostingIndex<?>
getInvertedIndex()
Returns the InvertedIndex to use for this indexIndex
getIthShard(int i)
Lexicon<java.lang.String>
getLexicon()
Return the Lexicon associated with this indexMetaIndex
getMetaIndex()
Get the Meta Index structureint
getNumberOfShards()
Returns the number of index shards that this incremental index containsboolean
hasIndexStructure(java.lang.String structureName)
Returns true iff the structure existsjava.lang.String
toString()
-
Methods inherited from class org.terrier.structures.Index
createIndex, createIndex, getEnd, getIndexStructure, getStart, hasIndexStructureInputStream, makeDirectIndexRef, setIndexLoadingProfileAsRetrieval
-
-
-
-
Field Detail
-
indices
protected java.util.List<Index> indices
-
selectiveMatchingPolicy
protected IncrementalSelectiveMatching selectiveMatchingPolicy
Selective Matching policy, a policy for accessing only subsets of the indices within this multi-index.
-
blocks
protected boolean blocks
-
fields
protected boolean fields
-
-
Constructor Detail
-
MultiIndex
public MultiIndex(Index[] indices, boolean blocks, boolean fields)
Constructor.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getIndexRef
public IndexRef getIndexRef()
Description copied from class:Index
Returns a direct IndexRef to this index- Specified by:
getIndexRef
in classIndex
-
getLexicon
public Lexicon<java.lang.String> getLexicon()
Return the Lexicon associated with this index- Specified by:
getLexicon
in classIndex
-
getInvertedIndex
public PostingIndex<?> getInvertedIndex()
Returns the InvertedIndex to use for this index- Specified by:
getInvertedIndex
in classIndex
-
getMetaIndex
public MetaIndex getMetaIndex()
Get the Meta Index structure- Specified by:
getMetaIndex
in classIndex
-
getDocumentIndex
public DocumentIndex getDocumentIndex()
Return the DocumentIndex associated with this index- Specified by:
getDocumentIndex
in classIndex
-
getCollectionStatistics
public CollectionStatistics getCollectionStatistics()
Get the collection statistics- Specified by:
getCollectionStatistics
in classIndex
-
getDirectIndex
public PostingIndex<?> getDirectIndex()
Description copied from class:Index
Return the DirectIndex associated with this index- Specified by:
getDirectIndex
in classIndex
-
hasIndexStructure
public boolean hasIndexStructure(java.lang.String structureName)
Description copied from class:Index
Returns true iff the structure exists- Overrides:
hasIndexStructure
in classIndex
-
getIndexStructureInputStream
public java.lang.Object getIndexStructureInputStream(java.lang.String structureName)
Not implemented.- Overrides:
getIndexStructureInputStream
in classIndex
-
close
public void close() throws java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Throws:
java.io.IOException
-
getIthShard
public Index getIthShard(int i)
-
getNumberOfShards
public int getNumberOfShards()
Returns the number of index shards that this incremental index contains- Returns:
- integer number of shards
-
-