- // Get number of results
- $titleMatchesNum = $titleMatches ? $titleMatches->numRows() : 0;
- $textMatchesNum = $textMatches ? $textMatches->numRows() : 0;
- // Total initial query matches (possible false positives)
- $num = $titleMatchesNum + $textMatchesNum;
-
- // Get total actual results (after second filtering, if any)
- $numTitleMatches = $titleMatches && !is_null( $titleMatches->getTotalHits() ) ?
- $titleMatches->getTotalHits() : $titleMatchesNum;
- $numTextMatches = $textMatches && !is_null( $textMatches->getTotalHits() ) ?
- $textMatches->getTotalHits() : $textMatchesNum;
-
- // get total number of results if backend can calculate it
- $totalRes = 0;
- if ( $titleMatches && !is_null( $titleMatches->getTotalHits() ) ) {
- $totalRes += $titleMatches->getTotalHits();
- }
- if ( $textMatches && !is_null( $textMatches->getTotalHits() ) ) {
- $totalRes += $textMatches->getTotalHits();
- }
-
- // show number of results and current offset
- $out->addHTML( $this->formHeader( $term, $num, $totalRes ) );
- $out->addHtml( $this->getProfileForm( $this->profile, $term ) );
-
- $out->addHtml( Xml::closeElement( 'form' ) );