|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.egothor.core.query.Rider
public class Rider
When a query needs an access to an index, it gets a Rider. In most cases, the Rider is generated by a Barrel that will be accessed by the Rider. This method of construction is beneficial because the Rider can limit itself as to the maximum number of inverted lists it will read.
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.
Field Summary | |
---|---|
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 |
Constructor Summary | |
---|---|
Rider(int size,
Barrel b,
ResultList res)
Constructor for the Rider object. |
Method Summary | |
---|---|
boolean |
accepted(int sim)
Accept the document currently being read as a hit. |
void |
close()
Close all inverted lists of this rider. |
boolean |
defined(java.lang.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(java.lang.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(java.lang.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(java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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 ResultListMethod Detail |
---|
public long getLength(java.lang.String term)
term
- the term for which the inverted list was constructed
public boolean defined(java.lang.String term)
defined
in interface CWI
term
- the term in question
public double idf(java.lang.String term)
idf
in interface CWI
term
- the term in question
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(java.lang.String term, int mode, IListShadow washer)
term
- the term in questionmode
- see MODE_XXX of this ilistwasher
- Description of the Parameter
public boolean isExhaused()
public long guessedHits()
public long foundHits()
public long size()
public boolean accepted(int sim)
sim
- the calculated similarity
public long headUid()
public long headUid(int mode)
mode
- see MODE_XXX
public 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 processed
IListReader.skipTo(long)
public void close()
public long nextHit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |