MediaWiki master
MediaWiki\Search\SearchIndexField Interface Reference

Inherited by MediaWiki\Search\NullIndexField, and MediaWiki\Search\SearchIndexFieldDefinition.

Public Member Functions

 checkFlag ( $flag)
 Check if flag is set.
 
 getEngineHints (SearchEngine $engine)
 A list of search engine hints for this field.
 
 getMapping (SearchEngine $engine)
 Get mapping for specific search engine.
 
 merge (SearchIndexField $that)
 Merge two field definitions if possible.
 
 setFlag ( $flag, $unset=false)
 Set global flag for this field.
 

Public Attributes

const FLAG_CASEFOLD = 1
 Generic field flags.
 
const FLAG_NO_HIGHLIGHT = 4
 This field does not need highlight handling.
 
const FLAG_NO_INDEX = 8
 Do not index this field, just store it.
 
const FLAG_SCORING = 2
 This field contains secondary information, which is already present in other fields, but can be used for scoring.
 
const INDEX_TYPE_BOOL = 'bool'
 
const INDEX_TYPE_DATETIME = 'datetime'
 
const INDEX_TYPE_INTEGER = 'integer'
 
const INDEX_TYPE_KEYWORD = 'keyword'
 KEYWORD fields are indexed without any processing, so are appropriate for e.g.
 
const INDEX_TYPE_NESTED = 'nested'
 
const INDEX_TYPE_NUMBER = 'number'
 
const INDEX_TYPE_SHORT_TEXT = 'short_text'
 SHORT_TEXT is meant to be used with short text made of mostly ascii technical information.
 
const INDEX_TYPE_TEXT = 'text'
 TEXT fields are suitable for natural language and may be subject to analysis such as stemming.
 

Detailed Description

Definition at line 13 of file SearchIndexField.php.

Member Function Documentation

◆ checkFlag()

MediaWiki\Search\SearchIndexField::checkFlag ( $flag)

Check if flag is set.

Parameters
int$flag
Returns
int 0 if unset, !=0 if set

Implemented in MediaWiki\Search\NullIndexField, and MediaWiki\Search\SearchIndexFieldDefinition.

◆ getEngineHints()

MediaWiki\Search\SearchIndexField::getEngineHints ( SearchEngine $engine)

A list of search engine hints for this field.

Hints are usually specific to a search engine implementation and allow to fine control how the search engine will handle this particular field.

For example some search engine permits some optimizations at index time by ignoring an update if the updated value does not change by more than X% on a numeric value.

Parameters
SearchEngine$engine
Returns
array an array of hints generally indexed by hint name. The type of values is search engine specific
Since
1.30

Implemented in MediaWiki\Search\NullIndexField, and MediaWiki\Search\SearchIndexFieldDefinition.

◆ getMapping()

MediaWiki\Search\SearchIndexField::getMapping ( SearchEngine $engine)

Get mapping for specific search engine.

Parameters
SearchEngine$engine
Returns
array|null Null means this field does not map to anything

Implemented in MediaWiki\Search\DummySearchIndexFieldDefinition, MediaWiki\Search\NullIndexField, and MediaWiki\Search\SearchIndexFieldDefinition.

◆ merge()

MediaWiki\Search\SearchIndexField::merge ( SearchIndexField $that)

Merge two field definitions if possible.

Parameters
SearchIndexField$that
Returns
SearchIndexField|false New definition or false if not mergeable.

Implemented in MediaWiki\Search\NullIndexField, and MediaWiki\Search\SearchIndexFieldDefinition.

◆ setFlag()

MediaWiki\Search\SearchIndexField::setFlag ( $flag,
$unset = false )

Set global flag for this field.

Parameters
int$flagBit flag to set/unset
bool$unsetTrue if flag should be unset, false by default
Returns
$this

Implemented in MediaWiki\Search\NullIndexField, and MediaWiki\Search\SearchIndexFieldDefinition.

Member Data Documentation

◆ FLAG_CASEFOLD

const MediaWiki\Search\SearchIndexField::FLAG_CASEFOLD = 1

Generic field flags.

This field is case-insensitive.

Definition at line 51 of file SearchIndexField.php.

◆ FLAG_NO_HIGHLIGHT

const MediaWiki\Search\SearchIndexField::FLAG_NO_HIGHLIGHT = 4

This field does not need highlight handling.

Definition at line 63 of file SearchIndexField.php.

◆ FLAG_NO_INDEX

const MediaWiki\Search\SearchIndexField::FLAG_NO_INDEX = 8

Do not index this field, just store it.

Definition at line 68 of file SearchIndexField.php.

◆ FLAG_SCORING

const MediaWiki\Search\SearchIndexField::FLAG_SCORING = 2

This field contains secondary information, which is already present in other fields, but can be used for scoring.

Definition at line 58 of file SearchIndexField.php.

◆ INDEX_TYPE_BOOL

const MediaWiki\Search\SearchIndexField::INDEX_TYPE_BOOL = 'bool'

Definition at line 35 of file SearchIndexField.php.

◆ INDEX_TYPE_DATETIME

const MediaWiki\Search\SearchIndexField::INDEX_TYPE_DATETIME = 'datetime'

Definition at line 33 of file SearchIndexField.php.

◆ INDEX_TYPE_INTEGER

const MediaWiki\Search\SearchIndexField::INDEX_TYPE_INTEGER = 'integer'

Definition at line 31 of file SearchIndexField.php.

◆ INDEX_TYPE_KEYWORD

const MediaWiki\Search\SearchIndexField::INDEX_TYPE_KEYWORD = 'keyword'

KEYWORD fields are indexed without any processing, so are appropriate for e.g.

URLs. The content will often consist of a single token.

Definition at line 30 of file SearchIndexField.php.

◆ INDEX_TYPE_NESTED

const MediaWiki\Search\SearchIndexField::INDEX_TYPE_NESTED = 'nested'

◆ INDEX_TYPE_NUMBER

const MediaWiki\Search\SearchIndexField::INDEX_TYPE_NUMBER = 'number'

Definition at line 32 of file SearchIndexField.php.

◆ INDEX_TYPE_SHORT_TEXT

const MediaWiki\Search\SearchIndexField::INDEX_TYPE_SHORT_TEXT = 'short_text'

SHORT_TEXT is meant to be used with short text made of mostly ascii technical information.

Generally a language agnostic analysis chain is used and aggressive splitting to increase recall. E.g suited for mime/type

Definition at line 43 of file SearchIndexField.php.

◆ INDEX_TYPE_TEXT

const MediaWiki\Search\SearchIndexField::INDEX_TYPE_TEXT = 'text'

TEXT fields are suitable for natural language and may be subject to analysis such as stemming.

Read more: https://wikimediafoundation.org/2018/08/07/anatomy-search-token-affection/ https://wikimediafoundation.org/2018/09/13/anatomy-search-variation-under-nature/

Definition at line 25 of file SearchIndexField.php.


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