/** @var int */
protected $offset = 0;
- /** @var array|string */
+ /**
+ * @var string[]
+ * @deprecated since 1.34
+ */
protected $searchTerms = [];
/** @var bool */
* be converted to final in 1.34. Override self::doSearchText().
*
* @param string $term Raw search term
- * @return SearchResultSet|Status|null
+ * @return ISearchResultSet|Status|null
*/
public function searchText( $term ) {
return $this->maybePaginate( function () use ( $term ) {
* Perform a full text search query and return a result set.
*
* @param string $term Raw search term
- * @return SearchResultSet|Status|null
+ * @return ISearchResultSet|Status|null
* @since 1.32
*/
protected function doSearchText( $term ) {
* be converted to final in 1.34. Override self::doSearchArchiveTitle().
*
* @param string $term Raw search term
- * @return Status<Title[]>
+ * @return Status
* @since 1.29
*/
public function searchArchiveTitle( $term ) {
* Perform a title search in the article archive.
*
* @param string $term Raw search term
- * @return Status<Title[]>
+ * @return Status
* @since 1.32
*/
protected function doSearchArchiveTitle( $term ) {
* be converted to final in 1.34. Override self::doSearchTitle().
*
* @param string $term Raw search term
- * @return SearchResultSet|null
+ * @return ISearchResultSet|null
*/
public function searchTitle( $term ) {
return $this->maybePaginate( function () use ( $term ) {
* Perform a title-only search query and return a result set.
*
* @param string $term Raw search term
- * @return SearchResultSet|null
+ * @return ISearchResultSet|null
* @since 1.32
*/
protected function doSearchTitle( $term ) {
* explicitly implement their own pagination.
*
* @param Closure $fn Takes no arguments
- * @return SearchResultSet|Status<SearchResultSet>|null Result of calling $fn
+ * @return ISearchResultSet|Status<ISearchResultSet>|null Result of calling $fn
*/
private function maybePaginate( Closure $fn ) {
if ( $this instanceof PaginatingSearchEngine ) {
}
$resultSet = null;
- if ( $resultSetOrStatus instanceof SearchResultSet ) {
+ if ( $resultSetOrStatus instanceof ISearchResultSet ) {
$resultSet = $resultSetOrStatus;
} elseif ( $resultSetOrStatus instanceof Status &&
- $resultSetOrStatus->getValue() instanceof SearchResultSet
+ $resultSetOrStatus->getValue() instanceof ISearchResultSet
) {
$resultSet = $resultSetOrStatus->getValue();
}
return MediaWikiServices::getInstance()->getContentLanguage()->segmentByWord( $string );
}
- /**
- * Transform search term in cases when parts of the query came as different
- * GET params (when supported), e.g. for prefix queries:
- * search=test&prefix=Main_Page/Archive -> test prefix:Main Page/Archive
- * @param string $term
- * @return string
- * @deprecated since 1.32 this should now be handled internally by the
- * search engine
- */
- public function transformSearchTerm( $term ) {
- wfDeprecated( __METHOD__, '1.34' );
- return $term;
- }
-
/**
* Get service class to finding near matches.
* @param Config $config Configuration to use for the matcher.
/**
* Augment search results with extra data.
*
- * @param SearchResultSet $resultSet
+ * @param ISearchResultSet $resultSet
*/
- public function augmentSearchResults( SearchResultSet $resultSet ) {
+ public function augmentSearchResults( ISearchResultSet $resultSet ) {
$setAugmentors = [];
$rowAugmentors = [];
Hooks::run( "SearchResultsAugment", [ &$setAugmentors, &$rowAugmentors ] );