MediaWiki REL1_33
|
Basic infrastructure of the field definition. More...
Public Member Functions | |
__construct ( $name, $type) | |
checkFlag ( $flag) | |
Check if flag is set. | |
getEngineHints (SearchEngine $engine) | |
@inheritDoc | |
getIndexType () | |
Get index type. | |
getMapping (SearchEngine $engine) | |
getName () | |
Get field name. | |
getSubfields () | |
Get subfields. | |
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) | |
Set subfields. | |
Protected Attributes | |
int | $flags = 0 |
Bit flags for the field. | |
string | $name |
Name of the field. | |
SearchIndexFieldDefinition[] | $subfields = [] |
Subfields. | |
int | $type |
Type of the field, one of the constants above. | |
Private Attributes | |
callable | $mergeCallback |
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 = 6 |
const | INDEX_TYPE_DATETIME = 4 |
const | INDEX_TYPE_INTEGER = 2 |
const | INDEX_TYPE_KEYWORD = 1 |
KEYWORD fields are indexed without any processing, so are appropriate for e.g. | |
const | INDEX_TYPE_NESTED = 5 |
const | INDEX_TYPE_NUMBER = 3 |
const | INDEX_TYPE_SHORT_TEXT = 7 |
SHORT_TEXT is meant to be used with short text made of mostly ascii technical information. | |
const | INDEX_TYPE_TEXT = 0 |
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 at least, override the getMapping method, but can reuse other parts.
Definition at line 11 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::__construct | ( | $name, | |
$type ) |
string | $name | Field name |
int | $type | Index type |
Definition at line 49 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::checkFlag | ( | $flag | ) |
Check if flag is set.
int | $flag |
Implements SearchIndexField.
Definition at line 91 of file SearchIndexFieldDefinition.php.
References and().
SearchIndexFieldDefinition::getEngineHints | ( | SearchEngine | $engine | ) |
@inheritDoc
Implements SearchIndexField.
Definition at line 150 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::getIndexType | ( | ) |
Get index type.
Definition at line 66 of file SearchIndexFieldDefinition.php.
References $type.
|
abstract |
SearchEngine | $engine |
Implements SearchIndexField.
Reimplemented in DummySearchIndexFieldDefinition.
SearchIndexFieldDefinition::getName | ( | ) |
Get field name.
Definition at line 58 of file SearchIndexFieldDefinition.php.
References $name.
SearchIndexFieldDefinition::getSubfields | ( | ) |
Get subfields.
Definition at line 118 of file SearchIndexFieldDefinition.php.
References $subfields.
SearchIndexFieldDefinition::merge | ( | SearchIndexField | $that | ) |
Merge two field definitions if possible.
SearchIndexField | $that |
Implements SearchIndexField.
Definition at line 101 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 77 of file SearchIndexFieldDefinition.php.
References and().
SearchIndexFieldDefinition::setMergeCallback | ( | $callback | ) |
Set field-specific merge strategy.
callable | $callback |
Definition at line 143 of file SearchIndexFieldDefinition.php.
SearchIndexFieldDefinition::setSubfields | ( | array | $subfields | ) |
Set subfields.
SearchIndexFieldDefinition[] | $subfields |
Definition at line 127 of file SearchIndexFieldDefinition.php.
References $subfields, and and().
|
protected |
Bit flags for the field.
Definition at line 32 of file SearchIndexFieldDefinition.php.
Referenced by DummySearchIndexFieldDefinition\getMapping().
|
private |
Definition at line 43 of file SearchIndexFieldDefinition.php.
|
protected |
Name of the field.
Definition at line 18 of file SearchIndexFieldDefinition.php.
Referenced by __construct(), DummySearchIndexFieldDefinition\getMapping(), and getName().
|
protected |
Subfields.
Definition at line 38 of file SearchIndexFieldDefinition.php.
Referenced by getSubfields(), and setSubfields().
|
protected |
Type of the field, one of the constants above.
Definition at line 25 of file SearchIndexFieldDefinition.php.
Referenced by __construct(), getIndexType(), and DummySearchIndexFieldDefinition\getMapping().