Class LexicalCluster
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.Index
-
- it.unimi.di.big.mg4j.index.cluster.IndexCluster
-
- it.unimi.di.big.mg4j.index.cluster.LexicalCluster
-
- All Implemented Interfaces:
Serializable
public class LexicalCluster extends IndexCluster
A cluster exhibiting local indices referring to the same collection, but containing different set of terms, as a single index.- Author:
- Alessandro Arrabito, Sebastiano Vigna
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unimi.di.big.mg4j.index.cluster.IndexCluster
IndexCluster.PropertyKeys
-
Nested classes/interfaces inherited from class it.unimi.di.big.mg4j.index.Index
Index.EmptyIndexIterator, Index.UriKeys
-
-
Field Summary
Fields Modifier and Type Field Description protected LexicalPartitioningStrategypartitioningStrategyThe strategy, cast to a partition strategy, ornull.protected LexicalClusteringStrategystrategyThe strategy to be used.-
Fields inherited from class it.unimi.di.big.mg4j.index.cluster.IndexCluster
BLOOM_EXTENSION, localIndex, STRATEGY_DEFAULT_EXTENSION, termFilter
-
Fields inherited from class it.unimi.di.big.mg4j.index.Index
field, hasCounts, hasPayloads, hasPositions, keyIndex, maxCount, numberOfDocuments, numberOfOccurrences, numberOfPostings, numberOfTerms, payload, prefixMap, properties, singletonSet, sizes, termMap, termProcessor
-
-
Constructor Summary
Constructors Constructor Description LexicalCluster(Index[] localIndex, LexicalClusteringStrategy strategy, BloomFilter<Void>[] termFilter, int numberOfDocuments, int numberOfTerms, long numberOfPostings, long numberOfOccurrences, int maxCount, Payload payload, boolean hasCounts, boolean hasPositions, TermProcessor termProcessor, String field, IntBigList sizes, Properties properties)Creates a new lexical index cluster.
-
Method Summary
Modifier and Type Method Description IndexIteratordocuments(CharSequence prefix, int limit)Creates a number of instances ofIndexReaderfor this index and uses them to return aMultiTermIndexIteratorover 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, anUnsupportedOperationExceptionwill be thrown.IndexReadergetReader(int bufferSize)Creates and returns a newIndexReaderbased on this index.-
Methods inherited from class it.unimi.di.big.mg4j.index.cluster.IndexCluster
getInstance, keyIndex
-
Methods inherited from class it.unimi.di.big.mg4j.index.Index
documents, documents, getEmptyIndexIterator, getEmptyIndexIterator, getEmptyIndexIterator, getEmptyIndexIterator, getInstance, getInstance, getInstance, getInstance, getInstance, getReader, getTermProcessor
-
-
-
-
Field Detail
-
strategy
protected final LexicalClusteringStrategy strategy
The strategy to be used.
-
partitioningStrategy
protected final LexicalPartitioningStrategy partitioningStrategy
The strategy, cast to a partition strategy, ornull.
-
-
Constructor Detail
-
LexicalCluster
public LexicalCluster(Index[] localIndex, LexicalClusteringStrategy strategy, BloomFilter<Void>[] termFilter, int numberOfDocuments, int numberOfTerms, long numberOfPostings, long numberOfOccurrences, int maxCount, Payload payload, boolean hasCounts, boolean hasPositions, TermProcessor termProcessor, String field, IntBigList sizes, Properties properties)
Creates a new lexical index cluster.
-
-
Method Detail
-
getReader
public IndexReader getReader(int bufferSize) throws IOException
Description copied from class:IndexCreates and returns a newIndexReaderbased on this index. After that, you can use the reader to read this index.- Specified by:
getReaderin classIndex- Parameters:
bufferSize- the size of the buffer to be used accessing the reader, or -1 for a default buffer size.- Returns:
- a new
IndexReaderto read this index. - Throws:
IOException
-
documents
public IndexIterator documents(CharSequence prefix, int limit) throws IOException, TooManyTermsException
Description copied from class:IndexCreates a number of instances ofIndexReaderfor this index and uses them to return aMultiTermIndexIteratorover 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, anUnsupportedOperationExceptionwill be thrown.- Overrides:
documentsin classIndex- 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 withprefixare more thanlimit, aTooManyTermsExceptionwill be thrown.- Throws:
TooManyTermsException- if there are more thanlimitterms starting withprefix.IOException
-
-