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

Basic ElasticSearch index field. More...

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

Public Member Functions

 __construct ( $name, $type, SearchConfig $config)
 
 setMappingFlags ( $flags)
 Set flags for specific mapping.
 
 getMapping (SearchEngine $engine)
 Get mapping for specific search engine.
 

Static Public Member Functions

static addIndexingHints (Document $doc, $fieldName, array $hints)
 Inspect SearchIndexField::getEngineHints() for indexing hints and forward them to special metadata in the document.
 
static addNoopHandler (\Elastica\Param $doc, $field, $handler)
 Add a special metadata to $doc to control the noop_script.
 
static getHint (\Elastica\Param $doc, $hint)
 Get the hint named $hint.
 
static setHint (\Elastica\Param $doc, $hint, $value)
 Set the hint named $hint.
 
static resetHints (Param $doc)
 Clear all hints.
 

Public Attributes

const DOC_HINT_PARAM = '_cirrus_hints'
 Name of the param on \Elastica\Document that contains hints about the noop_script handlers.
 
const MULTILIST_HANDLER = 'multilist'
 name of the noop handler for multilist
 
const MULTILIST_DELETE_GROUPING = '__DELETE_GROUPING__'
 magic word to instruct the noop plugin to cleanup a particular multilist group
 
const NOOP_HINT = 'noop'
 Name of the hint as returned by SearchIndexField::getEngineHints()
 

Protected Attributes

 $typeName = 'unknown'
 
 $config
 
 $mappingFlags
 

Detailed Description

Basic ElasticSearch index field.

Since
1.28

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Search\CirrusIndexField::__construct ( $name,
$type,
SearchConfig $config )
Parameters
string$name
string$type
SearchConfig$config

Reimplemented in CirrusSearch\Search\SourceTextIndexField.

Member Function Documentation

◆ addIndexingHints()

static CirrusSearch\Search\CirrusIndexField::addIndexingHints ( Document $doc,
$fieldName,
array $hints )
static

Inspect SearchIndexField::getEngineHints() for indexing hints and forward them to special metadata in the document.

Parameters
Document$doc
string$fieldName
array$hints

◆ addNoopHandler()

static CirrusSearch\Search\CirrusIndexField::addNoopHandler ( \Elastica\Param $doc,
$field,
$handler )
static

Add a special metadata to $doc to control the noop_script.

Parameters
\Elastica\Param$doc
string$field
string | array$handlerthe handler as understood by the super_noop_script

◆ getHint()

static CirrusSearch\Search\CirrusIndexField::getHint ( \Elastica\Param $doc,
$hint )
static

Get the hint named $hint.

Parameters
\Elastica\Param$doc
string$hintname of the hint
Returns
mixed|null the hint value or null if inexistent

◆ getMapping()

CirrusSearch\Search\CirrusIndexField::getMapping ( SearchEngine $engine)

Get mapping for specific search engine.

Parameters
SearchEngine$engine
Returns
array

Reimplemented in CirrusSearch\Search\DatetimeIndexField, CirrusSearch\Search\NestedIndexField, and CirrusSearch\Search\SourceTextIndexField.

◆ resetHints()

static CirrusSearch\Search\CirrusIndexField::resetHints ( Param $doc)
static

Clear all hints.

Parameters
Param$doc

◆ setHint()

static CirrusSearch\Search\CirrusIndexField::setHint ( \Elastica\Param $doc,
$hint,
$value )
static

Set the hint named $hint.

Parameters
\Elastica\Param$doc
string$hintname of the hint
mixed$valuethe hint value

◆ setMappingFlags()

CirrusSearch\Search\CirrusIndexField::setMappingFlags ( $flags)

Set flags for specific mapping.

Parameters
int$flags
Returns
self

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