RESULTS_PER_BLOCK
RESULTS_PER_BLOCK
Default number of documents returned for each block (at most)
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.
A description of how words and the documents containing them are stored is given in the documentation of IndexArchiveBundle.
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
__construct(string $word_key, string $index_name, boolean $raw = false, \seekquarry\yioop\library\index_bundle_iterators\SearchfiltersModel $filter = null, integer $results_per_block = \seekquarry\yioop\library\index_bundle_iterators\IndexBundleIterator::RESULTS_PER_BLOCK, integer $direction = self::ASCENDING)
Creates a word iterator with the given parameters.
string | $word_key | hash of word or phrase to iterate docs of |
string | $index_name | time_stamp of the to use |
boolean | $raw | whether the $word_key is our variant of base64 encoded |
\seekquarry\yioop\library\index_bundle_iterators\SearchfiltersModel | $filter | Model responsible for keeping track of edited and deleted search results |
integer | $results_per_block | the maximum number of results that can be returned by a findDocsWithWord call |
integer | $direction | when results are access from $index_name in which order they should be presented. self::ASCENDING is from first added to last added, self::DESCENDING is from last added to first added. Note: this value is not saved permanently. So you could in theory open two read only versions of the same bundle but reading the results in different directions |