PHP Класс Elastica\Type\Mapping

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_mapping Mapping.
$_type Type.

Открытые методы

Метод Описание
__construct ( Type $type = null, array $properties = [] ) Construct Mapping.
create ( array | Mapping $mapping ) : self Creates a mapping object.
disableSource ( boolean $enabled = false ) Disables the source in the index.
enableAllField ( boolean $enabled = true ) Enables the "_all" field.
enableTtl ( boolean $enabled = true ) Enables TTL for all documents in this type.
getParam ( string $key ) : mixed Get raw parameters.
getProperties ( ) : array Gets the mapping properties.
getType ( ) : Type Returns mapping type.
send ( array $query = [] ) : Response Submits the mapping and sends it to the server.
setAllField ( array $params ) Sets params for the "_all" field.
setMeta ( array $meta ) Sets the mapping _meta.
setParam ( string $key, mixed $value ) Sets raw parameters.
setParent ( string $type ) Set parent type.
setProperties ( array $properties ) Sets the mapping properties.
setSource ( array $source ) Sets source values.
setTtl ( array $params ) Set TTL.
setType ( Type $type ) Sets the mapping type Enter description here .
toArray ( ) : array Converts the mapping to an array.

Описание методов

__construct() публичный Метод

Construct Mapping.
public __construct ( Type $type = null, array $properties = [] )
$type Elastica\Type OPTIONAL Type object
$properties array OPTIONAL Properties

create() публичный статический Метод

Creates a mapping object.
public static create ( array | Mapping $mapping ) : self
$mapping array | Mapping Mapping object or properties array
Результат self

disableSource() публичный Метод

Param can be set to true to enable again
public disableSource ( boolean $enabled = false )
$enabled boolean OPTIONAL (default = false)

enableAllField() публичный Метод

Enables the "_all" field.
public enableAllField ( boolean $enabled = true )
$enabled boolean OPTIONAL (default = true)

enableTtl() публичный Метод

Enables TTL for all documents in this type.
public enableTtl ( boolean $enabled = true )
$enabled boolean OPTIONAL (default = true)

getParam() публичный Метод

Get raw parameters.
См. также: setParam
public getParam ( string $key ) : mixed
$key string Key name
Результат mixed $value Key value

getProperties() публичный Метод

Gets the mapping properties.
public getProperties ( ) : array
Результат array $properties Properties

getType() публичный Метод

Returns mapping type.
public getType ( ) : Type
Результат Elastica\Type Type

send() публичный Метод

Submits the mapping and sends it to the server.
public send ( array $query = [] ) : Response
$query array Query string parameters to send with mapping
Результат Elastica\Response Response object

setAllField() публичный Метод

Sets params for the "_all" field.
public setAllField ( array $params )
$params array _all Params (enabled, store, term_vector, analyzer)

setMeta() публичный Метод

Sets the mapping _meta.
public setMeta ( array $meta )
$meta array metadata

setParam() публичный Метод

Possible options: _uid _id _type _source _all _analyzer _boost _parent _routing _index _size properties
public setParam ( string $key, mixed $value )
$key string Key name
$value mixed Key value

setParent() публичный Метод

Set parent type.
public setParent ( string $type )
$type string Parent type

setProperties() публичный Метод

Sets the mapping properties.
public setProperties ( array $properties )
$properties array Properties

setSource() публичный Метод

To disable source, argument is array('enabled' => false)
public setSource ( array $source )
$source array Source array

setTtl() публичный Метод

Set TTL.
public setTtl ( array $params )
$params array TTL Params (enabled, default, ...)

setType() публичный Метод

..
public setType ( Type $type )
$type Elastica\Type Type object

toArray() публичный Метод

Converts the mapping to an array.
public toArray ( ) : array
Результат array Mapping as array

Описание свойств

$_mapping защищенное свойство

Mapping.
protected $_mapping

$_type защищенное свойство

Type.
protected $_type