CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Maintenance\MappingConfigBuilder Class Reference

Builds elasticsearch mapping configuration arrays. More...

+ Inheritance diagram for CirrusSearch\Maintenance\MappingConfigBuilder:

Public Member Functions

 __construct ( $optimizeForExperimentalHighlighter, $flags=0, SearchConfig $config=null, CirrusSearchHookRunner $cirrusSearchHookRunner=null)
 
 buildConfig ()
 Build the mapping config.
 
 canOptimizeAnalysisConfig ()
 Whether or not it's safe to optimize the analysis config.
 

Public Attributes

const PREFIX_START_WITH_ANY = 1
 
const PHRASE_SUGGEST_USE_TEXT = 2
 
const OPTIMIZE_FOR_EXPERIMENTAL_HIGHLIGHTER = 4
 
const VERSION = '1.10'
 Version number for the core analysis.
 

Protected Member Functions

 buildSourceTextStringField ( $fieldName)
 Build the source_text index field.
 

Protected Attributes

 $engine
 
 $searchIndexFieldFactory
 
 $flags = 0
 

Detailed Description

Builds elasticsearch mapping configuration arrays.

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\Maintenance\MappingConfigBuilder::__construct ( $optimizeForExperimentalHighlighter,
$flags = 0,
SearchConfig $config = null,
CirrusSearchHookRunner $cirrusSearchHookRunner = null )
Parameters
bool$optimizeForExperimentalHighlightershould the index be optimized for the experimental highlighter?
int$flags
SearchConfig | null$config
CirrusSearchHookRunner | null$cirrusSearchHookRunner

Member Function Documentation

◆ buildConfig()

CirrusSearch\Maintenance\MappingConfigBuilder::buildConfig ( )

Build the mapping config.

Returns
array the mapping config

Reimplemented in CirrusSearch\Maintenance\ArchiveMappingConfigBuilder.

◆ buildSourceTextStringField()

CirrusSearch\Maintenance\MappingConfigBuilder::buildSourceTextStringField ( $fieldName)
protected

Build the source_text index field.

Parameters
string$fieldNameusually "source_text"
Returns
SourceTextIndexField

◆ canOptimizeAnalysisConfig()

CirrusSearch\Maintenance\MappingConfigBuilder::canOptimizeAnalysisConfig ( )

Whether or not it's safe to optimize the analysis config.

It's generally safe to optimize if all the analyzers needed are properly referenced in the mapping. In the case an analyzer is used directly in a query but not referenced in the mapping it's not safe to optimize.

Returns
bool

Reimplemented in CirrusSearch\Maintenance\ArchiveMappingConfigBuilder.

Member Data Documentation

◆ VERSION

const CirrusSearch\Maintenance\MappingConfigBuilder::VERSION = '1.10'

Version number for the core analysis.

Increment the major version when the analysis changes in an incompatible way, and change the minor version when it changes but isn't incompatible


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