PHP Класс Elastica\Type\AbstractType

This abstract model should help creating search index and a subtype with some easy config entries that are overloaded. The following variables have to be set: - $_indexName - $_typeName The following variables can be set for additional configuration - $_mapping: Value type mapping for the given type - $_indexParams: Parameters for the index
Автор: Nicolas Ruflin ([email protected])
Наследование: implements Elastica\SearchableInterface
Показать файл Открыть проект

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

Свойство Тип Описание
$_client Client.
$_index Index.
$_indexName Index name.
$_indexParams Index params.
$_mapping Mapping.
$_source Source.
$_type Type.
$_typeName Index name.

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

Метод Описание
__construct ( Client $client = null ) Creates index object with client connection.
convertDate ( integer $date ) : string Converts given time to format: 1995-12-31T23:59:59Z.
count ( string | array | Query $query = '' ) : integer Count docs in the type based on query.
create ( boolean $recreate = false ) Creates the index and sets the mapping for this type.
createSearch ( string | Query $query = '', array | integer $options = null ) : Search
getIndex ( ) : Index Returns the search index.
getType ( ) : Type Returns type object.
search ( string | array | Query $query = '', null $options = null ) : ResultSet Search on the type.

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

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

Reads index and type name from protected vars _indexName and _typeName. Has to be set in child class
public __construct ( Client $client = null )
$client Elastica\Client OPTIONAL Client object

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

This is the lucene date format
public convertDate ( integer $date ) : string
$date integer Date input (could be string etc.) -> must be supported by strtotime
Результат string Converted date string

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

Count docs in the type based on query.
См. также: Elastica\SearchableInterface::count
public count ( string | array | Query $query = '' ) : integer
$query string | array | Elastica\Query Array with all query data inside or a Elastica\Query object
Результат integer number of documents matching the query

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

Creates the index and sets the mapping for this type.
public create ( boolean $recreate = false )
$recreate boolean OPTIONAL Recreates the index if true (default = false)

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

public createSearch ( string | Query $query = '', array | integer $options = null ) : Search
$query string | Elastica\Query
$options array | integer
Результат Elastica\Search

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

Returns the search index.
public getIndex ( ) : Index
Результат Elastica\Index Index object

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

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

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

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

Client.
protected $_client

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

Index.
protected $_index

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

Index name.
protected $_indexName

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

Index params.
protected $_indexParams

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

Mapping.
protected $_mapping

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

Source.
protected $_source

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

Type.
protected $_type

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

Index name.
protected $_typeName