|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TermFunction
Interface for classes that manipulate Lucene Term, Document data. This class works in conjunction with the TermScorer. Methods on this interface will be called by the TermScorer as it iterates through the terms and documents. The TermScorer iteration looks like:
init(int)
for all terms:newTerm(org.apache.lucene.index.Term)
for all documents: calc scoreapply(int, org.apache.lucene.document.Document, int, float)
done()
Note that a Term contains a field and so the actual term text may occur more than once.
Method Summary | |
---|---|
void |
apply(int docId,
org.apache.lucene.document.Document doc,
int frequency,
float score)
Apply some implementor specific operation to the term and its data. |
void |
done()
Called after apply has been called for all the terms. |
void |
init(int docCount)
Called once prior to calling apply for any terms, documents. |
void |
newTerm(org.apache.lucene.index.Term term)
Called when a new Term is encounters during iterator. |
Method Detail |
---|
void init(int docCount) throws AIDAException
docCount
- the number of documents in the index.
AIDAException
- if there is an error during initialization.void newTerm(org.apache.lucene.index.Term term)
term
- the new term.void apply(int docId, org.apache.lucene.document.Document doc, int frequency, float score) throws AIDAException
newTerm(org.apache.lucene.index.Term)
.
docId
- the numeric id of the document. This is only valid between calls to init
and done.doc
- the document the term applies tofrequency
- the frequency count of the term in the documentscore
- the score of this term for the specified document.
AIDAException
- if there is an error.void done() throws AIDAException
AIDAException
- if there is an error during the "done" phase.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |