seek_quarry
[ class tree: seek_quarry ] [ index: seek_quarry ] [ all elements ]

Class: IndexBundleIterator

Source Location: /lib/index_bundle_iterators/index_bundle_iterator.php

Class Overview


Abstract classed used to model iterating documents indexed in an IndexArchiveBundle or set of such bundles.


Author(s):

  • Chris Pollett

Implements interfaces:

Variables

Constants

Methods


Child classes:

DocIterator
Used to iterate through all the documents and links associated with a an IndexArchiveBundle. It iterates through each doc or link regarless of the words it contains. It also makes it easy to get the summaries of these documents.
GroupIterator
This iterator is used to group together documents or document parts
IntersectIterator
Used to iterate over the documents which occur in all of a set of iterator results
NegationIterator
Used to iterate over the documents which dont' occur in a set of iterator results
NetworkIterator
This iterator is used to handle querying a network of queue_servers with regard to a query
UnionIterator
Used to iterate over the documents which occur in any of a set of WordIterator results
WordIterator
Used to iterate through the documents associated with a word in an IndexArchiveBundle. It also makes it easy to get the summaries of these documents.

Class Details

[line 46]
Abstract classed used to model iterating documents indexed in an IndexArchiveBundle or set of such bundles.



Tags:

author:  Chris Pollett
see:  IndexArchiveBundle
abstract:  


[ Top ]


Class Variables

$count_block =

[line 65]

The number of documents in the current block


Type:   int


[ Top ]

$current_block_fresh =

[line 77]

Says whether the value in $this->count_block is up to date


Type:   bool


[ Top ]

$num_docs =

[line 53]

Estimate of the number of documents that this iterator can return


Type:   int


[ Top ]

$pages =

[line 71]

Cache of what currentDocsWithWord returns


Type:   array


[ Top ]

$results_per_block =  self::RESULTS_PER_BLOCK

[line 83]

Number of documents returned for each block (at most)


Type:   int


[ Top ]

$seen_docs =

[line 59]

The number of documents already iterated over


Type:   int


[ Top ]



Class Methods


method advance [line 114]

void advance( [array $gen_doc_offset = null])

Forwards the iterator one group of docs



Tags:

abstract:  


Overridden in child classes as:

DocIterator::advance()
Forwards the iterator one group of docs
GroupIterator::advance()
Forwards the iterator one group of docs
IntersectIterator::advance()
Forwards the iterator one group of docs
NegationIterator::advance()
Forwards the iterator one group of docs (must be size 1)
NetworkIterator::advance()
Forwards the iterator one group of docs
UnionIterator::advance()
Forwards the iterator one group of docs
WordIterator::advance()
Forwards the iterator one group of docs

Parameters:

array   $gen_doc_offset   a generation, doc_offset pair. If set, the must be of greater than or equal generation, and if equal the next block must all have $doc_offsets larger than or equal to this value

[ Top ]

method advanceSeenDocs [line 238]

void advanceSeenDocs( )

Updates the seen_docs count during an advance() call



Overridden in child classes as:

DocIterator::advanceSeenDocs()
Updates the seen_docs count during an advance() call
WordIterator::advanceSeenDocs()
Updates the seen_docs count during an advance() call

[ Top ]

method computeRelevance [line 99]

float computeRelevance( int $generation, int $posting_offset)

Computes a relevancy score for a posting offset with respect to this

iterator and generation




Tags:

return:  a relevancy score based on BM25F.
abstract:  


Overridden in child classes as:

DocIterator::computeRelevance()
Computes a relevancy score for a posting offset with respect to this iterator and generation. This method is required from the base class, but as a doc iterator doesn't use a posting list, we just resturn 1.0 for this iiterator.
GroupIterator::computeRelevance()
Computes a relevancy score for a posting offset with respect to this
IntersectIterator::computeRelevance()
Computes a relevancy score for a posting offset with respect to this
NegationIterator::computeRelevance()
Computes a relevancy score for a posting offset with respect to this
NetworkIterator::computeRelevance()
Computes a relevancy score for a posting offset with respect to this
UnionIterator::computeRelevance()
Computes a relevancy score for a posting offset with respect to this
WordIterator::computeRelevance()
Computes a relevancy score for a posting offset with respect to this

Parameters:

int   $generation   the generation the posting offset is for
int   $posting_offset   an offset into word_docs to compute the relevance of

[ Top ]

method currentDocsWithWord [line 164]

mixed currentDocsWithWord( )

Gets the current block of doc ids and score associated with the this iterators word



Tags:

return:  doc ids and score if there are docs left, -1 otherwise


[ Top ]

method currentGenDocOffsetWithWord [line 123]

mixed currentGenDocOffsetWithWord( )

Gets the doc_offset and generation for the next document that would be return by this iterator



Tags:

return:  an array with the desired document offset and generation; -1 on fail
abstract:  


Overridden in child classes as:

DocIterator::currentGenDocOffsetWithWord()
Gets the doc_offset and generation for the next document that would be return by this iterator
GroupIterator::currentGenDocOffsetWithWord()
Gets the doc_offset and generation for the next document that would be return by this iterator
IntersectIterator::currentGenDocOffsetWithWord()
Gets the doc_offset and generation for the next document that would be return by this iterator
NegationIterator::currentGenDocOffsetWithWord()
Gets the doc_offset and generation for the next document that would be return by this iterator
NetworkIterator::currentGenDocOffsetWithWord()
Gets the doc_offset and generation for the next document that
UnionIterator::currentGenDocOffsetWithWord()
This method is supposed to get the doc_offset and generation
WordIterator::currentGenDocOffsetWithWord()
Gets the doc_offset and generation for the next document that would be return by this iterator

[ Top ]

method findDocsWithWord [line 131]

mixed findDocsWithWord( )

Hook function used by currentDocsWithWord to return the current block of docs if it is not cached



Tags:

return:  doc ids and score if there are docs left, -1 otherwise
abstract:  


Overridden in child classes as:

DocIterator::findDocsWithWord()
Hook function used by currentDocsWithWord to return the current block of docs if it is not cached
GroupIterator::findDocsWithWord()
Hook function used by currentDocsWithWord to return the current block of docs if it is not cached
IntersectIterator::findDocsWithWord()
Hook function used by currentDocsWithWord to return the current block of docs if it is not cached
NegationIterator::findDocsWithWord()
Hook function used by currentDocsWithWord to return the current block of docs if it is not cached
NetworkIterator::findDocsWithWord()
Hook function used by currentDocsWithWord to return the current block of docs if it is not cached
UnionIterator::findDocsWithWord()
Hook function used by currentDocsWithWord to return the current block of docs if it is not cached
WordIterator::findDocsWithWord()
Hook function used by currentDocsWithWord to return the current block of docs if it is not cached

[ Top ]

method genDocOffsetCmp [line 140]

int genDocOffsetCmp( array $gen_doc1, $gen_doc2)

Compares two arrays each containing a (generation, offset) pair.



Tags:

return:  -1,0,1 depending on which is bigger


Parameters:

array   $gen_doc1   second ordered pair
   $gen_doc2  

[ Top ]

method getCurrentDocsForKeys [line 180]

array getCurrentDocsForKeys( [array $keys = NULL])

Gets the summaries associated with the keys provided the keys

can be found in the current block of docs returned by this iterator




Tags:

return:  doc summaries that match provided keys


Overridden in child classes as:

NetworkIterator::getCurrentDocsForKeys()
Gets the summaries associated with the keys provided the keys
UnionIterator::getCurrentDocsForKeys()
Gets the summaries associated with the keys provided the keys

Parameters:

array   $keys   keys to try to find in the current block of returned results

[ Top ]

method nextDocsWithWord [line 221]

array nextDocsWithWord( [$doc_offset $doc_offset = NULL])

Get the current block of doc summaries for the word iterator and advances the current pointer to the next block of documents. If a doc index is the next block must be of docs after this doc_index



Tags:

return:  doc summaries matching the $this->restrict_phrases


Parameters:

$doc_offset   $doc_offset   if set the next block must all have $doc_offsets equal to or larger than this value

[ Top ]

method reset [line 105]

void reset( )

Returns the iterators to the first document block that it could iterate

over




Tags:

abstract:  


Overridden in child classes as:

DocIterator::reset()
Returns the iterators to the first document block that it could iterate
GroupIterator::reset()
Returns the iterators to the first document block that it could iterate
IntersectIterator::reset()
Returns the iterators to the first document block that it could iterate
NegationIterator::reset()
Returns the iterators to the first document block that it could iterate
NetworkIterator::reset()
Returns the iterators to the first document block that it could iterate
UnionIterator::reset()
Returns the iterators to the first document block that it could iterate
WordIterator::reset()
Returns the iterators to the first document block that it could iterate

[ Top ]

method setResultsPerBlock [line 258]

void setResultsPerBlock( int $num)

Sets the value of the result_per_block field. This field controls the maximum number of results that can be returned in one go by currentDocsWithWord()



Overridden in child classes as:

IntersectIterator::setResultsPerBlock()
This method is supposed to set
NegationIterator::setResultsPerBlock()
This method is supposed to set
UnionIterator::setResultsPerBlock()
This method is supposed to set

Parameters:

int   $num   the maximum number of results that can be returned by a block

[ Top ]


Class Constants

RESULTS_PER_BLOCK =  200

[line 89]

Default number of documents returned for each block (at most)


[ Top ]



Documentation generated by phpDocumentor 1.4.3