CirrusSearch
Elasticsearch-powered search for MediaWiki
|
A set of results from Elasticsearch. More...
Public Member Functions | |
__construct ( $searchContainedSyntax=false, \Elastica\ResultSet $elasticResultSet=null, TitleHelper $titleHelper=null) | |
setSuggestionQuery (string $suggestionQuery, $suggestionSnippet=null) | |
getTotalHits () | |
Some search modes return a total hit count for the query in the entire article database. | |
hasSuggestion () | |
getSuggestionQuery () | |
getSuggestionSnippet () | |
extractResults () | |
addInterwikiResults (CirrusSearchResultSet $res, $type, $interwiki) | |
getInterwikiResults ( $type=self::SECONDARY_RESULTS) | |
hasInterwikiResults ( $type=self::SECONDARY_RESULTS) | |
setRewrittenQuery (string $newQuery, $newQuerySnippet=null) | |
hasRewrittenQuery () | |
getQueryAfterRewrite () | |
getQueryAfterRewriteSnippet () | |
getElasticResponse () | |
getElasticaResultSet () | |
count () | |
Count elements of an object https://php.net/manual/en/countable.count.php. | |
numRows () | |
searchContainedSyntax () | |
Did the search contain search syntax? If so, Special:Search won't offer the user a link to a create a page named by the search string because the name would contain the search syntax. | |
hasMoreResults () | |
shrink ( $limit) | |
extractTitles () | |
Extract all the titles in the result set. | |
Protected Member Functions | |
preCacheContainedTitles (\Elastica\ResultSet $resultSet) | |
Loads the result set into the mediawiki LinkCache via a batch query. | |
transformOneResult (\Elastica\Result $result) | |
Protected Attributes | |
$results | |
A set of results from Elasticsearch.
Extending this class from another extension is not supported, use BaseCirrusSearchResultSet
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html
CirrusSearch\Search\ResultSet::__construct | ( | $searchContainedSyntax = false, | |
\Elastica\ResultSet | $elasticResultSet = null, | ||
TitleHelper | $titleHelper = null ) |
bool | $searchContainedSyntax | |
\Elastica\ResultSet | null | $elasticResultSet | |
TitleHelper | null | $titleHelper |
CirrusSearch\Search\ResultSet::addInterwikiResults | ( | CirrusSearchResultSet | $res, |
$type, | |||
$interwiki ) |
CirrusSearchResultSet | $res | |
int | $type | One of SearchResultSet::* constants |
string | $interwiki |
Implements CirrusSearch\Search\CirrusSearchResultSet.
CirrusSearch\Search\ResultSet::count | ( | ) |
Count elements of an object https://php.net/manual/en/countable.count.php.
CirrusSearch\Search\ResultSet::extractTitles | ( | ) |
Extract all the titles in the result set.
CirrusSearch\Search\ResultSet::getElasticaResultSet | ( | ) |
Implements CirrusSearch\Search\CirrusSearchResultSet.
CirrusSearch\Search\ResultSet::getElasticResponse | ( | ) |
Implements CirrusSearch\Search\CirrusSearchResultSet.
CirrusSearch\Search\ResultSet::getInterwikiResults | ( | $type = self::SECONDARY_RESULTS | ) |
int | $type |
CirrusSearch\Search\ResultSet::getQueryAfterRewrite | ( | ) |
CirrusSearch\Search\ResultSet::getQueryAfterRewriteSnippet | ( | ) |
CirrusSearch\Search\ResultSet::getSuggestionQuery | ( | ) |
CirrusSearch\Search\ResultSet::getSuggestionSnippet | ( | ) |
CirrusSearch\Search\ResultSet::getTotalHits | ( | ) |
Some search modes return a total hit count for the query in the entire article database.
This may include pages in namespaces that would not be matched on the given settings.
Return null if no total hits number is supported.
CirrusSearch\Search\ResultSet::hasInterwikiResults | ( | $type = self::SECONDARY_RESULTS | ) |
int | $type |
CirrusSearch\Search\ResultSet::hasMoreResults | ( | ) |
CirrusSearch\Search\ResultSet::hasRewrittenQuery | ( | ) |
CirrusSearch\Search\ResultSet::hasSuggestion | ( | ) |
CirrusSearch\Search\ResultSet::numRows | ( | ) |
|
protected |
Loads the result set into the mediawiki LinkCache via a batch query.
By pre-caching this we ensure methods such as Result::isMissingRevision() don't trigger a query for each and every search result.
\Elastica\ResultSet | $resultSet | Result set from which the titles come |
CirrusSearch\Search\ResultSet::searchContainedSyntax | ( | ) |
Did the search contain search syntax? If so, Special:Search won't offer the user a link to a create a page named by the search string because the name would contain the search syntax.
CirrusSearch\Search\ResultSet::setRewrittenQuery | ( | string | $newQuery, |
$newQuerySnippet = null ) |
string | $newQuery | |
HtmlArmor | string | null | $newQuerySnippet |
Implements CirrusSearch\Search\CirrusSearchResultSet.
CirrusSearch\Search\ResultSet::setSuggestionQuery | ( | string | $suggestionQuery, |
$suggestionSnippet = null ) |
string | $suggestionQuery | |
HtmlArmor | string | null | $suggestionSnippet |
Implements CirrusSearch\Search\CirrusSearchResultSet.
CirrusSearch\Search\ResultSet::shrink | ( | $limit | ) |
int | $limit | Shrink result set to $limit and flag if more results are available. |
|
protected |
\Elastica\Result | $result | Result from search engine |