RESULTS_PER_BLOCK
RESULTS_PER_BLOCK
Default number of documents returned for each block (at most)
Used to iterate over the documents which occur in any of a set of WordIterator results
currentGenDocOffsetWithWord() : mixed
This method is supposed to get the doc_offset and generation for the next document that would be return by this iterator. As the union iterator as written returns a block of size at least the number of iterators in it, and this iterator is intended to be used when results_per_block is 1, we generate a user defined error.
the desired document offset and generation (actually, triggers error).
genDocOffsetCmp(array $gen_doc1, array $gen_doc2, integer $direction = self::ASCENDING) : integer
Compares two arrays each containing a (generation, offset) pair.
array | $gen_doc1 | first ordered pair |
array | $gen_doc2 | second ordered pair |
integer | $direction | whether the comparison should be done for a self::ASCEDNING or a self::DESCENDING search |
-1,0,1 depending on which is bigger
getCurrentDocsForKeys(array $keys = null) : array
Gets the summaries associated with the keys provided the keys can be found in the current block of docs returned by this iterator
array | $keys | keys to try to find in the current block of returned results |
doc summaries that match provided keys
nextDocsWithWord( $doc_offset = null) : array
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
$doc_offset | if set the next block must all have $doc_offsets equal to or larger than this value |
doc summaries matching the $this->restrict_phrases
setResultsPerBlock(integer $num)
This method is supposed to set 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(). This method cannot be consistently implemented for this iterator and expect it to behave nicely it this iterator is used together with intersect_iterator. So to prevent a user for doing this, calling this method results in a user defined error
integer | $num | the maximum number of results that can be returned by a block |