it.unimi.di.mg4j.index.cluster
Class DocumentalCluster

java.lang.Object
  extended by it.unimi.di.mg4j.index.Index
      extended by it.unimi.di.mg4j.index.cluster.IndexCluster
          extended by it.unimi.di.mg4j.index.cluster.DocumentalCluster
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DocumentalConcatenatedCluster, DocumentalMergedCluster

public abstract class DocumentalCluster
extends IndexCluster

A abstract class representing a cluster of local indices containing separate set of documents from the same collection.

This class stores the strategy and possibly the Bloom filters associated with this documental cluster.

Author:
Alessandro Arrabito, Sebastiano Vigna
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.di.mg4j.index.cluster.IndexCluster
IndexCluster.PropertyKeys
 
Nested classes/interfaces inherited from class it.unimi.di.mg4j.index.Index
Index.EmptyIndexIterator, Index.UriKeys
 
Field Summary
 int[] allIndices
          An Array containing the numbers from 0 to the number of local indices (excluded).
 boolean concatenated
          Whether this documental cluster is concatenated.
static int DEFAULT_BUFFER_SIZE
           
 boolean flat
          Whether this documental cluster is flat; in this case, all local indices have the same term list.
protected  DocumentalClusteringStrategy strategy
          The clustering strategy.
 
Fields inherited from class it.unimi.di.mg4j.index.cluster.IndexCluster
BLOOM_EXTENSION, localIndex, STRATEGY_DEFAULT_EXTENSION, termFilter
 
Fields inherited from class it.unimi.di.mg4j.index.Index
field, hasCounts, hasPayloads, hasPositions, keyIndex, maxCount, numberOfDocuments, numberOfOccurrences, numberOfPostings, numberOfTerms, payload, prefixMap, properties, singletonSet, sizes, termMap, termProcessor
 
Constructor Summary
DocumentalCluster(Index[] localIndex, DocumentalClusteringStrategy strategy, boolean flat, BloomFilter[] termFilter, int numberOfDocuments, int numberOfTerms, long numberOfPostings, long numberOfOccurences, int maxCount, Payload payload, boolean hasCounts, boolean hasPositions, TermProcessor termProcessor, String field, IntList sizes, Properties properties)
          Creates a new documental index cluster.
 
Method Summary
 IndexIterator documents(CharSequence prefix, int limit)
          Creates a number of instances of IndexReader for this index and uses them to return a MultiTermIndexIterator over the documents containing any term our of a set of terms defined by a prefix; the prefix is given explicitly, and unless the index has a prefix map, an UnsupportedOperationException will be thrown.
 DocumentalClusterIndexReader getReader(int bufferSize)
          Creates and returns a new IndexReader based on this index.
 String toString()
           
 
Methods inherited from class it.unimi.di.mg4j.index.cluster.IndexCluster
getInstance, keyIndex
 
Methods inherited from class it.unimi.di.mg4j.index.Index
documents, documents, getEmptyIndexIterator, getEmptyIndexIterator, getEmptyIndexIterator, getEmptyIndexIterator, getInstance, getInstance, getInstance, getInstance, getInstance, getReader, getTermProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
See Also:
Constant Field Values

concatenated

public final boolean concatenated
Whether this documental cluster is concatenated.


flat

public final boolean flat
Whether this documental cluster is flat; in this case, all local indices have the same term list.


allIndices

public final int[] allIndices
An Array containing the numbers from 0 to the number of local indices (excluded). Used to implement IndexReader.documents(int) more efficiently in flat indices.


strategy

protected final DocumentalClusteringStrategy strategy
The clustering strategy.

Constructor Detail

DocumentalCluster

public DocumentalCluster(Index[] localIndex,
                         DocumentalClusteringStrategy strategy,
                         boolean flat,
                         BloomFilter[] termFilter,
                         int numberOfDocuments,
                         int numberOfTerms,
                         long numberOfPostings,
                         long numberOfOccurences,
                         int maxCount,
                         Payload payload,
                         boolean hasCounts,
                         boolean hasPositions,
                         TermProcessor termProcessor,
                         String field,
                         IntList sizes,
                         Properties properties)
Creates a new documental index cluster.

Method Detail

getReader

public DocumentalClusterIndexReader getReader(int bufferSize)
                                       throws IOException
Description copied from class: Index
Creates and returns a new IndexReader based on this index. After that, you can use the reader to read this index.

Specified by:
getReader in class Index
Parameters:
bufferSize - the size of the buffer to be used accessing the reader, or -1 for a default buffer size.
Returns:
a new IndexReader to read this index.
Throws:
IOException

documents

public IndexIterator documents(CharSequence prefix,
                               int limit)
                        throws IOException,
                               TooManyTermsException
Description copied from class: Index
Creates a number of instances of IndexReader for this index and uses them to return a MultiTermIndexIterator over the documents containing any term our of a set of terms defined by a prefix; the prefix is given explicitly, and unless the index has a prefix map, an UnsupportedOperationException will be thrown.

Overrides:
documents in class Index
Parameters:
prefix - a prefix.
limit - a limit on the number of terms that will be used to resolve the prefix query; if the terms starting with prefix are more than limit, a TooManyTermsException will be thrown.
Throws:
TooManyTermsException - if there are more than limit terms starting with prefix.
IOException

toString

public String toString()
Overrides:
toString in class Object