Change-Id: I036434268f1e7992f7f9f23d2c1c0fcd399823c8
12 files changed:
&$titleSnippet: Label for the link representing the search result. Typically the
article title.
$result: The SearchResult object
&$titleSnippet: Label for the link representing the search result. Typically the
article title.
$result: The SearchResult object
-$terms: String of the search terms entered
+$terms: array of search terms extracted by SearchDatabase search engines
+ (may not be populated by other search engines).
$specialSearch: The SpecialSearch object
&$query: Array of query string parameters for the link representing the search
result.
$specialSearch: The SpecialSearch object
&$query: Array of query string parameters for the link representing the search
result.
/** @var int */
protected $offset = 0;
/** @var int */
protected $offset = 0;
- /** @var array|string */
protected $searchTerms = [];
/** @var bool */
protected $searchTerms = [];
/** @var bool */
* Wikitext highlighting when $wgAdvancedSearchHighlighting = true
*
* @param string $text
* Wikitext highlighting when $wgAdvancedSearchHighlighting = true
*
* @param string $text
- * @param array $terms Terms to highlight (not html escaped but
+ * @param string[] $terms Terms to highlight (not html escaped but
* regex escaped via SearchDatabase::regexTerm())
* @param int $contextlines
* @param int $contextchars
* regex escaped via SearchDatabase::regexTerm())
* @param int $contextlines
* @param int $contextchars
* Used when $wgAdvancedSearchHighlighting is false.
*
* @param string $text
* Used when $wgAdvancedSearchHighlighting is false.
*
* @param string $text
- * @param array $terms Escaped for regex by SearchDatabase::regexTerm()
+ * @param string[] $terms Escaped for regex by SearchDatabase::regexTerm()
* @param int $contextlines
* @param int $contextchars
* @return string
* @param int $contextlines
* @param int $contextchars
* @return string
- * @param array $terms Terms to highlight
+ * @param string[] $terms Terms to highlight
* @return string Highlighted text snippet, null (and not '') if not supported
*/
function getTextSnippet( $terms ) {
* @return string Highlighted text snippet, null (and not '') if not supported
*/
function getTextSnippet( $terms ) {
* the search terms as parsed by this engine in a text extract.
* STUB
*
* the search terms as parsed by this engine in a text extract.
* STUB
*
*/
function termMatches() {
return [];
*/
function termMatches() {
return [];
class SqlSearchResultSet extends SearchResultSet {
/** @var ResultWrapper Result object from database */
protected $resultSet;
class SqlSearchResultSet extends SearchResultSet {
/** @var ResultWrapper Result object from database */
protected $resultSet;
- /** @var string Requested search query */
+ /** @var string[] Requested search query */
protected $terms;
/** @var int|null Total number of hits for $terms */
protected $totalHits;
protected $terms;
/** @var int|null Total number of hits for $terms */
protected $totalHits;
/**
* @param SearchResult $result The result to render
/**
* @param SearchResult $result The result to render
- * @param string $terms Terms to be highlighted (@see SearchResult::getTextSnippet)
+ * @param string[] $terms Terms to be highlighted (@see SearchResult::getTextSnippet)
* @param int $position The result position, including offset
* @return string HTML
*/
* @param int $position The result position, including offset
* @return string HTML
*/
* title with highlighted words).
*
* @param SearchResult $result
* title with highlighted words).
*
* @param SearchResult $result
+ * @param string[] $terms
* @param int $position
* @return string HTML
*/
* @param int $position
* @return string HTML
*/
/**
* @param SearchResult $result The result to render
/**
* @param SearchResult $result The result to render
- * @param string $terms Terms to be highlighted (@see SearchResult::getTextSnippet)
+ * @param string[] $terms Terms to be highlighted (@see SearchResult::getTextSnippet)
* @param int $position The result position, including offset
* @return string HTML
*/
* @param int $position The result position, including offset
* @return string HTML
*/
interface SearchResultWidget {
/**
* @param SearchResult $result The result to render
interface SearchResultWidget {
/**
* @param SearchResult $result The result to render
- * @param string $terms Terms to be highlighted (@see SearchResult::getTextSnippet)
+ * @param string[] $terms Terms to be highlighted (@see SearchResult::getTextSnippet)
* @param int $position The zero indexed result position, including offset
* @return string HTML
*/
* @param int $position The zero indexed result position, including offset
* @return string HTML
*/
/**
* @param SearchResult $result The result to render
/**
* @param SearchResult $result The result to render
- * @param string $terms Terms to be highlighted (@see SearchResult::getTextSnippet)
+ * @param string[] $terms Terms to be highlighted (@see SearchResult::getTextSnippet)
* @param int $position The result position, including offset
* @return string HTML
*/
* @param int $position The result position, including offset
* @return string HTML
*/
- * @param array $termsArray
- * @return array
+ * @param string[] $termsArray
+ * @return string[]
*/
function convertForSearchResult( $termsArray ) {
# some languages, e.g. Chinese, need to do a conversion
*/
function convertForSearchResult( $termsArray ) {
# some languages, e.g. Chinese, need to do a conversion
- * @param array $termsArray
- * @return array
+ * @param string[] $termsArray
+ * @return string[]
*/
function convertForSearchResult( $termsArray ) {
$terms = implode( '|', $termsArray );
*/
function convertForSearchResult( $termsArray ) {
$terms = implode( '|', $termsArray );