CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Search\Result Class Reference

An individual search result from Elasticsearch. More...

+ Inheritance diagram for CirrusSearch\Search\Result:
+ Collaboration diagram for CirrusSearch\Search\Result:

Public Member Functions

 __construct ( $results, $result, ?TitleHelper $titleHelper=null)
 Build the result.
 
 getTitleSnippet ()
 
 getRedirectTitle ()
 
 getRedirectSnippet ()
 
 getTextSnippet ( $terms=[])
 
 getSectionSnippet ()
 
 getSectionTitle ()
 
 getCategorySnippet ()
 
 getWordCount ()
 
 getByteSize ()
 
 getTimestamp ()
 
 isFileMatch ()
 
 getInterwikiPrefix ()
 
 getInterwikiNamespaceText ()
 
 getDocId ()
 
 getScore ()
 
 getExplanation ()
 
- Public Member Functions inherited from CirrusSearch\Search\CirrusSearchResult
 __construct (Title $title)
 
 isBrokenTitle ()
 Check if this is result points to an invalid title.
 
 isMissingRevision ()
 Check if target page is missing, happens when index is out of date.
 
 getTitle ()
 
 getFile ()
 Get the file for this page, if one exists.
 

Protected Member Functions

 clearRedirectTitle ()
 Clear any redirect match so it won't be part of the result.
 
 getTitleHelper ()
 
- Protected Member Functions inherited from CirrusSearch\Search\CirrusSearchResult
 initFromTitle ( $title)
 Initialize from a Title and if possible initializes a corresponding File.
 
 initText ()
 Lazy initialization of article text from DB.
 
 containsHighlight (string $text)
 

Detailed Description

An individual search result from Elasticsearch.

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

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Search\Result::__construct ( $results,
$result,
?TitleHelper $titleHelper = null )

Build the result.

Parameters
mixed$resultsUnused
\Elastica\Result$resultcontaining the given search result
TitleHelper | null$titleHelper

Member Function Documentation

◆ clearRedirectTitle()

CirrusSearch\Search\Result::clearRedirectTitle ( )
protected

Clear any redirect match so it won't be part of the result.

Returns
bool True if the redirect was the only snippet available for this result.

Reimplemented from CirrusSearch\Search\CirrusSearchResult.

◆ getByteSize()

CirrusSearch\Search\Result::getByteSize ( )
Returns
int

◆ getCategorySnippet()

CirrusSearch\Search\Result::getCategorySnippet ( )
Returns
string

◆ getDocId()

CirrusSearch\Search\Result::getDocId ( )
Returns
string

Reimplemented from CirrusSearch\Search\CirrusSearchResult.

◆ getExplanation()

CirrusSearch\Search\Result::getExplanation ( )
Returns
array lucene score explanation

Reimplemented from CirrusSearch\Search\CirrusSearchResult.

◆ getInterwikiNamespaceText()

CirrusSearch\Search\Result::getInterwikiNamespaceText ( )
Returns
string

◆ getInterwikiPrefix()

CirrusSearch\Search\Result::getInterwikiPrefix ( )
Returns
string

◆ getRedirectSnippet()

CirrusSearch\Search\Result::getRedirectSnippet ( )
Returns
string

◆ getRedirectTitle()

CirrusSearch\Search\Result::getRedirectTitle ( )
Returns
Title|null

◆ getScore()

CirrusSearch\Search\Result::getScore ( )
Returns
float the score

Reimplemented from CirrusSearch\Search\CirrusSearchResult.

◆ getSectionSnippet()

CirrusSearch\Search\Result::getSectionSnippet ( )
Returns
string

◆ getSectionTitle()

CirrusSearch\Search\Result::getSectionTitle ( )
Returns
Title|null

◆ getTextSnippet()

CirrusSearch\Search\Result::getTextSnippet ( $terms = [])
Parameters
array$terms
Returns
string|null

◆ getTimestamp()

CirrusSearch\Search\Result::getTimestamp ( )
Returns
string

◆ getTitleHelper()

CirrusSearch\Search\Result::getTitleHelper ( )
protected
Returns
TitleHelper

◆ getTitleSnippet()

CirrusSearch\Search\Result::getTitleSnippet ( )
Returns
string

◆ getWordCount()

CirrusSearch\Search\Result::getWordCount ( )
Returns
int

◆ isFileMatch()

CirrusSearch\Search\Result::isFileMatch ( )
Returns
bool

The documentation for this class was generated from the following file: