public class Rider extends Object implements CWI
A Rider has the same features as an IListReader and a query uses it to get access to hit candidates. When it finds a hit, then the query communicates it to the Rider. The Rider analyzes its own current state and sends the hit to a ResultList.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
ALL
Move all inverted lists of this group
|
static boolean |
ANY
Move at least one inverted list
|
static int |
MODE_MAY
Inverted list of this mode should be available, but it is not needed
|
static int |
MODE_PRO
Inverted list of this mode is prohibited in queries
|
static int |
MODE_REQ
Inverted list of this mode is required for querying
|
IDF_UNKNOWN| Constructor and Description |
|---|
Rider(int size,
Barrel b,
ResultList res)
Constructor for the Rider object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepted(int sim)
Accept the document currently being read as a hit.
|
void |
close()
Close all inverted lists of this rider.
|
boolean |
defined(String term)
Test whether an inverted list has been constructed for the given term.
|
long |
foundHits()
Return the number of hits that were really read and identified as positive hits.
|
static CachedRider |
getCache()
Gets the cache used for caching inverted list pages.
|
long |
getLength(String term)
Return the length of the inverted list for the given term.
|
long |
guessedHits() |
boolean |
hasMoreElements()
Test whether more there are more documents to be read.
|
long |
headUid()
Return the unique ID of the document that is active in this Rider.
|
long |
headUid(int mode)
Return the uid of the doc just being read.
|
double |
idf(String term)
Return the inverse document frequency for the given term.
|
static void |
initializeCache(Cache<CachedTerm,CachedIListPage> cache,
int pageSize)
Initializes the cache to be used for caching inverted lists.
|
boolean |
isExhaused() |
long |
nextHit()
Move to the next hit candidate.
|
IListItem |
openIList(String term,
int mode,
IListShadow washer)
Return an IListReader capable of reading the inverted list
constructed for the given term.
|
long |
size()
Return the size of the Barrel that is accessed by this Rider.
|
long |
skipTo(boolean all,
long id,
int mode)
Move to the document with the given unique ID.
|
public static final int MODE_REQ
public static final int MODE_PRO
public static final int MODE_MAY
public static final boolean ALL
public static final boolean ANY
public Rider(int size,
Barrel b,
ResultList res)
size - the number of inverted lists in a Barrel this Rider
can openb - the Barrel containing the inverted list(s)res - hits will be communicated to the ResultListpublic long getLength(String term)
term - the term for which the inverted list was constructedpublic boolean defined(String term)
public double idf(String term)
public static void initializeCache(Cache<CachedTerm,CachedIListPage> cache, int pageSize)
cache - actual cache used for storing inverted list pagespageSize - capacity of the inverted list pagepublic static CachedRider getCache()
public IListItem openIList(String term, int mode, IListShadow washer)
term - the term in questionmode - see MODE_XXX of this ilistwasher - Description of the Parameterpublic boolean isExhaused()
public long guessedHits()
public long foundHits()
public long size()
public boolean accepted(int sim)
sim - the calculated similaritypublic long headUid()
public long headUid(int mode)
mode - see MODE_XXXpublic boolean hasMoreElements()
public long skipTo(boolean all,
long id,
int mode)
all - see ALL or ANYid - the ID of the document to move tomode - which group is processedIListReader.skipTo(long)public void close()
public long nextHit()
Copyright © 2016 Egothor. All Rights Reserved.