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 all of a set of iterator results
$quote_positions : array
Each element in this array corresponds to one quoted phrase in the original query. Each element is in turn an array with elements corresponding to a position of term in the orginal query followed its length (a term might involve more than one word so the length could be greater than one). It is also allowed that entries might be of the form *num => * to indicates that an asterisk (a wild card that can match any number of terms) appeared at that place in the query
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 union_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 |
__construct(object $index_bundle_iterators, array $word_iterator_map, array $quote_positions = null, float $weight = 1)
Creates an intersect iterator with the given parameters.
object | $index_bundle_iterators | to use as a source of documents to iterate over |
array | $word_iterator_map | ssociative array ( term position in original query => iterator index of an iterator for that term) |
array | $quote_positions | Each element in this array corresponds to one quoted phrase in the original query. @see $quote_positions field variable in this class for more info |
float | $weight | multiplicative factor to apply to scores returned from this iterator |
checkQuotes(array $position_lists) : boolean
Used to check if quoted terms in search query appear exactly in the position lists of the current document
array | $position_lists | of search terms in the current document |
whether the quoted terms in the search appear exactly
checkQuote(array $position_lists, integer $cur_pos, mixed $next_pos, $qp) : \seekquarry\yioop\library\index_bundle_iterators\-1
Auxiliary function for @see checkQuotes used to check if quoted terms in search query appear exactly in the position lists of the current document
array | $position_lists | of search terms in the current document |
integer | $cur_pos | to look after in any position list |
mixed | $next_pos |
|
$qp | $position_list_index => $len_of_list_term pairs |
on failure, 0 on backtrack, 1 on success
computeProximity(\seekquarry\yioop\library\index_bundle_iterators\array& $word_position_lists, \seekquarry\yioop\library\index_bundle_iterators\array& $word_len_lists, boolean $is_doc) : \seekquarry\yioop\library\index_bundle_iterators\sum
Given the position_lists of a collection of terms computes a score for how close those words were in the given document
\seekquarry\yioop\library\index_bundle_iterators\array& | $word_position_lists | a 2D array item number => position_list (locations in doc where item occurred) for that item. |
\seekquarry\yioop\library\index_bundle_iterators\array& | $word_len_lists | length for each item of its position list |
boolean | $is_doc | whether this is the position list of a document or a link |
of inverse of all covers computed by plane sweep algorithm