Package it.unimi.di.big.mg4j.index
Class QuasiSuccinctIndexReader
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.AbstractIndexReader
-
- it.unimi.di.big.mg4j.index.QuasiSuccinctIndexReader
-
- All Implemented Interfaces:
IndexReader
,SafelyCloseable
,Closeable
,AutoCloseable
public class QuasiSuccinctIndexReader extends AbstractIndexReader implements IndexReader
An index reader for quasi-succinct indices.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
protected static class
QuasiSuccinctIndexReader.CountReader
protected static class
QuasiSuccinctIndexReader.EliasFanoIndexIterator
protected static class
QuasiSuccinctIndexReader.EliasFanoPointerReader
protected static class
QuasiSuccinctIndexReader.LongWordBitReader
protected static class
QuasiSuccinctIndexReader.PointerReader
protected static class
QuasiSuccinctIndexReader.PositionReader
protected static class
QuasiSuccinctIndexReader.RankedIndexIterator
protected static class
QuasiSuccinctIndexReader.RankedPointerReader
-
Field Summary
Fields Modifier and Type Field Description protected LongBigList
countsList
A reference to the data for counts, ornull
ofindex
has counts.protected QuasiSuccinctIndexReader.EliasFanoIndexIterator
eliasFanoIndexIterator
An index iterator that can read Elias-Fano pointer lists.protected QuasiSuccinctIndex
index
The index, cached.protected LongBigList
pointersList
A reference to the data for pointers.protected QuasiSuccinctIndexReader.LongWordBitReader
pointersLongWordBitReader
A longword bit reader used to check whether a posting list is ranked or not.protected LongBigList
positionsList
A reference to the data for positions, ornull
ofindex
has positions.protected QuasiSuccinctIndexReader.LongWordBitReader
positionsLongWordBitReader
A longword bit reader used to retrieve values stored in the list of positions.protected QuasiSuccinctIndexReader.RankedIndexIterator
rankedIndexIterator
An index iterator that can read ranked pointer lists.-
Fields inherited from class it.unimi.di.big.mg4j.index.AbstractIndexReader
closed
-
-
Constructor Summary
Constructors Constructor Description QuasiSuccinctIndexReader(QuasiSuccinctIndex index)
-
Method Summary
Modifier and Type Method Description IndexIterator
documents(long termNumber)
Returns a document iterator over the documents containing a term.IndexIterator
documents(CharSequence term)
Returns an index iterator over the documents containing a term; the term is given explicitly.IndexIterator
nextIterator()
Throws anUnsupportedOperationException
.-
Methods inherited from class it.unimi.di.big.mg4j.index.AbstractIndexReader
close, finalize
-
-
-
-
Field Detail
-
eliasFanoIndexIterator
protected final QuasiSuccinctIndexReader.EliasFanoIndexIterator eliasFanoIndexIterator
An index iterator that can read Elias-Fano pointer lists.
-
rankedIndexIterator
protected final QuasiSuccinctIndexReader.RankedIndexIterator rankedIndexIterator
An index iterator that can read ranked pointer lists.
-
index
protected final QuasiSuccinctIndex index
The index, cached.
-
pointersList
protected final LongBigList pointersList
A reference to the data for pointers.
-
countsList
protected final LongBigList countsList
A reference to the data for counts, ornull
ofindex
has counts.
-
positionsList
protected final LongBigList positionsList
A reference to the data for positions, ornull
ofindex
has positions.
-
pointersLongWordBitReader
protected final QuasiSuccinctIndexReader.LongWordBitReader pointersLongWordBitReader
A longword bit reader used to check whether a posting list is ranked or not.
-
positionsLongWordBitReader
protected final QuasiSuccinctIndexReader.LongWordBitReader positionsLongWordBitReader
A longword bit reader used to retrieve values stored in the list of positions.
-
-
Constructor Detail
-
QuasiSuccinctIndexReader
public QuasiSuccinctIndexReader(QuasiSuccinctIndex index)
-
-
Method Detail
-
documents
public IndexIterator documents(long termNumber) throws IOException
Description copied from interface:IndexReader
Returns a document iterator over the documents containing a term.Note that the index iterator returned by this method will return
null
on a call toterm()
.Note that it is always possible to call this method with argument 0, even if the underlying index does not provide random access.
- Specified by:
documents
in interfaceIndexReader
- Parameters:
termNumber
- the number of a term.- Throws:
IOException
-
documents
public IndexIterator documents(CharSequence term) throws IOException
Description copied from interface:IndexReader
Returns an index iterator over the documents containing a term; the term is given explicitly.Unless the term processor of the associated index is
null
, words coming from a query will have to be processed before being used with this method.Note that the index iterator returned by this method will return
term
on a call toterm()
.- Specified by:
documents
in interfaceIndexReader
- Parameters:
term
- a term (the term will be downcased if the index is case insensitive).- Throws:
IOException
-
nextIterator
public IndexIterator nextIterator() throws IOException
Description copied from class:AbstractIndexReader
Throws anUnsupportedOperationException
.- Specified by:
nextIterator
in interfaceIndexReader
- Overrides:
nextIterator
in classAbstractIndexReader
- Returns:
- the index iterator of the next term, or
null
if there are no more terms after the current one. - Throws:
IOException
-
-