Class 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
    • 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 class java.lang.Object
      • getIndexRef

        public IndexRef getIndexRef()
        Description copied from class: Index
        Returns a direct IndexRef to this index
        Specified by:
        getIndexRef in class Index
      • getLexicon

        public Lexicon<java.lang.String> getLexicon()
        Return the Lexicon associated with this index
        Specified by:
        getLexicon in class Index
      • getDirectIndex

        public PostingIndex<?> getDirectIndex()
        Description copied from class: Index
        Return the DirectIndex associated with this index
        Specified by:
        getDirectIndex in class Index
      • hasIndexStructure

        public boolean hasIndexStructure​(java.lang.String structureName)
        Description copied from class: Index
        Returns true iff the structure exists
        Overrides:
        hasIndexStructure in class Index
      • getIndexStructureInputStream

        public java.lang.Object getIndexStructureInputStream​(java.lang.String structureName)
        Not implemented.
        Overrides:
        getIndexStructureInputStream in class Index
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class Index
        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