it.unimi.dsi.mg4j.index.cluster
Class LexicalCluster
java.lang.Object
it.unimi.dsi.mg4j.index.Index
it.unimi.dsi.mg4j.index.cluster.IndexCluster
it.unimi.dsi.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
Fields inherited from class it.unimi.dsi.mg4j.index.Index |
emptyIndexIterator, field, hasCounts, hasPayloads, hasPositions, keyIndex, maxCount, numberOfDocuments, numberOfOccurrences, numberOfPostings, numberOfTerms, payload, properties, singletonSet, sizes, termProcessor |
Constructor Summary |
LexicalCluster(Index[] localIndex,
LexicalClusteringStrategy strategy,
BloomFilter[] termFilter,
int numberOfDocuments,
int numberOfTerms,
long numberOfPostings,
long numberOfOccurrences,
int maxCount,
Payload payload,
boolean hasCounts,
boolean hasPositions,
TermProcessor termProcessor,
String field,
IntList sizes,
Properties properties)
Creates a new lexical index cluster. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
strategy
protected final LexicalClusteringStrategy strategy
- The strategy to be used.
partitioningStrategy
protected final LexicalPartitioningStrategy partitioningStrategy
- The strategy, cast to a partition strategy, or
null
.
LexicalCluster
public LexicalCluster(Index[] localIndex,
LexicalClusteringStrategy strategy,
BloomFilter[] termFilter,
int numberOfDocuments,
int numberOfTerms,
long numberOfPostings,
long numberOfOccurrences,
int maxCount,
Payload payload,
boolean hasCounts,
boolean hasPositions,
TermProcessor termProcessor,
String field,
IntList sizes,
Properties properties)
- Creates a new lexical index cluster.
getReader
public IndexReader 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 document iterator over the documents containing 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.
This method is not provided by IndexReader
because it requires the
creation of several index readers at the same time. These readers must be
disposed afterwards.
- Specified by:
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:
IOException
- if an exception occurred while accessing the index.
TooManyTermsException
- if there are more than limit
terms starting with prefix
.