MediaWiki master
|
Basic infrastructure of the field definition. More...
Inherits SearchIndexField.
Inherited by DummySearchIndexFieldDefinition.
Public Member Functions | ||||
__construct ( $name, $type) | ||||
checkFlag ( $flag) | ||||
Check if flag is set. | ||||
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.
| ||||
getIndexType () | ||||
getMapping (SearchEngine $engine) | ||||
getName () | ||||
Get field name. | ||||
getSubfields () | ||||
merge (SearchIndexField $that) | ||||
Merge two field definitions if possible. | ||||
setFlag ( $flag, $unset=false) | ||||
Set global flag for this field. | ||||
setMergeCallback ( $callback) | ||||
Set field-specific merge strategy. | ||||
setSubfields (array $subfields) | ||||
Protected Attributes | |
int | $flags = 0 |
Bit flags for the field. | |
string | $name |
Name of the field. | |
SearchIndexFieldDefinition[] | $subfields = [] |
Subfields. | |
string | $type |
Type of the field, one of the constants above. | |
Additional Inherited Members | |
Public Attributes inherited from SearchIndexField | |
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. | |
Basic infrastructure of the field definition.
Specific engines should extend this class and at least, override the getMapping method, but can reuse other parts.
Definition at line 12 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::__construct | ( | $name, | |
$type ) |
string | $name | Field name |
string | $type | Index type |
Definition at line 50 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::checkFlag | ( | $flag | ) |
Check if flag is set.
int | $flag |
Implements SearchIndexField.
Definition at line 94 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::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.
SearchEngine | $engine |
Implements SearchIndexField.
Definition at line 152 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::getIndexType | ( | ) |
|
abstract |
SearchEngine | $engine |
Implements SearchIndexField.
Reimplemented in DummySearchIndexFieldDefinition.
SearchIndexFieldDefinition::getName | ( | ) |
Get field name.
Definition at line 59 of file SearchIndexFieldDefinition.php.
References $name.
SearchIndexFieldDefinition::getSubfields | ( | ) |
Definition at line 121 of file SearchIndexFieldDefinition.php.
References $subfields.
SearchIndexFieldDefinition::merge | ( | SearchIndexField | $that | ) |
Merge two field definitions if possible.
SearchIndexField | $that |
Implements SearchIndexField.
Definition at line 105 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::setFlag | ( | $flag, | |
$unset = false ) |
Set global flag for this field.
int | $flag | Bit flag to set/unset |
bool | $unset | True if flag should be unset, false by default |
Implements SearchIndexField.
Definition at line 78 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::setMergeCallback | ( | $callback | ) |
Set field-specific merge strategy.
callable | $callback |
Definition at line 145 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::setSubfields | ( | array | $subfields | ) |
SearchIndexFieldDefinition[] | $subfields |
Definition at line 129 of file SearchIndexFieldDefinition.php.
References $subfields.
|
protected |
Bit flags for the field.
Definition at line 33 of file SearchIndexFieldDefinition.php.
Referenced by DummySearchIndexFieldDefinition\getMapping().
|
protected |
Name of the field.
Definition at line 19 of file SearchIndexFieldDefinition.php.
Referenced by __construct(), DummySearchIndexFieldDefinition\getMapping(), and getName().
|
protected |
Subfields.
Definition at line 39 of file SearchIndexFieldDefinition.php.
Referenced by getSubfields(), and setSubfields().
|
protected |
Type of the field, one of the constants above.
Definition at line 26 of file SearchIndexFieldDefinition.php.
Referenced by __construct(), getIndexType(), and DummySearchIndexFieldDefinition\getMapping().