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 booleanblocksprotected booleanfieldsprotected java.util.List<Index>indicesprotected IncrementalSelectiveMatchingselectiveMatchingPolicySelective 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 voidclose()voidflush()CollectionStatisticsgetCollectionStatistics()Get the collection statisticsPostingIndex<?>getDirectIndex()Return the DirectIndex associated with this indexDocumentIndexgetDocumentIndex()Return the DocumentIndex associated with this indexIndexRefgetIndexRef()Returns a direct IndexRef to this indexjava.lang.ObjectgetIndexStructureInputStream(java.lang.String structureName)Not implemented.PostingIndex<?>getInvertedIndex()Returns the InvertedIndex to use for this indexIndexgetIthShard(int i)Lexicon<java.lang.String>getLexicon()Return the Lexicon associated with this indexMetaIndexgetMetaIndex()Get the Meta Index structureintgetNumberOfShards()Returns the number of index shards that this incremental index containsbooleanhasIndexStructure(java.lang.String structureName)Returns true iff the structure existsjava.lang.StringtoString()-
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:
toStringin classjava.lang.Object
-
getIndexRef
public IndexRef getIndexRef()
Description copied from class:IndexReturns a direct IndexRef to this index- Specified by:
getIndexRefin classIndex
-
getLexicon
public Lexicon<java.lang.String> getLexicon()
Return the Lexicon associated with this index- Specified by:
getLexiconin classIndex
-
getInvertedIndex
public PostingIndex<?> getInvertedIndex()
Returns the InvertedIndex to use for this index- Specified by:
getInvertedIndexin classIndex
-
getMetaIndex
public MetaIndex getMetaIndex()
Get the Meta Index structure- Specified by:
getMetaIndexin classIndex
-
getDocumentIndex
public DocumentIndex getDocumentIndex()
Return the DocumentIndex associated with this index- Specified by:
getDocumentIndexin classIndex
-
getCollectionStatistics
public CollectionStatistics getCollectionStatistics()
Get the collection statistics- Specified by:
getCollectionStatisticsin classIndex
-
getDirectIndex
public PostingIndex<?> getDirectIndex()
Description copied from class:IndexReturn the DirectIndex associated with this index- Specified by:
getDirectIndexin classIndex
-
hasIndexStructure
public boolean hasIndexStructure(java.lang.String structureName)
Description copied from class:IndexReturns true iff the structure exists- Overrides:
hasIndexStructurein classIndex
-
getIndexStructureInputStream
public java.lang.Object getIndexStructureInputStream(java.lang.String structureName)
Not implemented.- Overrides:
getIndexStructureInputStreamin 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
-
-