PHP Класс yii\elasticsearch\Command

Check the elasticsearch guide for details on these commands.
С версии: 2.0
Автор: Carsten Brandt ([email protected])
Наследование: extends yii\base\Component
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$db Connection
$index the indexes to execute the query on. Defaults to null meaning all indexes
$options options to be appended to the query URL, such as "search_type" for search or "timeout" for delete
$queryParts list of arrays or json strings that become parts of a query
$type the types to execute the query on. Defaults to null meaning all types

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

Метод Описание
clearIndexCache ( $index ) : mixed
clearScroll ( array $options = [] ) : mixed
closeIndex ( $index ) : mixed
createIndex ( $index, array $configuration = null ) : mixed creates an index
createTemplate ( $name, $pattern, $settings, $mappings, integer $order ) : mixed
delete ( $index, $type, $id, array $options = [] ) : mixed deletes a document from the index
deleteAllIndexes ( ) : mixed deletes all indexes
deleteByQuery ( array $options = [] ) : mixed Sends a request to the delete by query
deleteIndex ( $index ) : mixed deletes an index
deleteMapping ( $index, $type ) : mixed
deleteTemplate ( $name ) : mixed
exists ( $index, $type, $id ) : mixed gets a document from the index
flushIndex ( $index = '_all' ) : mixed
get ( $index, $type, $id, array $options = [] ) : mixed gets a document from the index
getIndexStatus ( $index = '_all' ) : mixed
getMapping ( string $index = '_all', string $type = null ) : mixed
getSource ( $index, $type, $id ) : mixed gets a documents _source from the index (>=v0.90.1)
getTemplate ( $name ) : mixed
indexExists ( $index ) : mixed checks whether an index exists
insert ( string $index, string $type, string | array $data, null $id = null, array $options = [] ) : mixed Inserts a document into an index
mget ( $index, $type, $ids, array $options = [] ) : mixed gets multiple documents from the index
openIndex ( $index ) : mixed
refreshIndex ( $index ) : mixed
scroll ( array $options = [] ) : mixed
search ( array $options = [] ) : mixed Sends a request to the _search API and returns the result
setMapping ( string $index, string $type, string | array $mapping, array $options = [] ) : mixed
suggest ( string | array $suggester, array $options = [] ) : mixed Sends a request to the _suggest API and returns the result
typeExists ( $index, $type ) : mixed
update ( $index, $type, $id, $data, array $options = [] ) : mixed updates a document
updateAnalyzers ( string $index, string | array $setting, array $options = [] ) : mixed Define new analyzers for the index.
updateSettings ( string $index, string | array $setting, array $options = [] ) : mixed Change specific index level settings in real time.

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

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html
public clearIndexCache ( $index ) : mixed
$index
Результат mixed

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

См. также: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
С версии: 2.0.4
public clearScroll ( array $options = [] ) : mixed
$options array
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html
public closeIndex ( $index ) : mixed
$index
Результат mixed

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

creates an index
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
public createIndex ( $index, array $configuration = null ) : mixed
$index
$configuration array
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
public createTemplate ( $name, $pattern, $settings, $mappings, integer $order ) : mixed
$name
$pattern
$settings
$mappings
$order integer
Результат mixed

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

deletes a document from the index
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html
public delete ( $index, $type, $id, array $options = [] ) : mixed
$index
$type
$id
$options array
Результат mixed

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

deletes all indexes
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html
public deleteAllIndexes ( ) : mixed
Результат mixed

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

Sends a request to the delete by query
public deleteByQuery ( array $options = [] ) : mixed
$options array
Результат mixed

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

deletes an index
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html
public deleteIndex ( $index ) : mixed
$index
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html
public deleteMapping ( $index, $type ) : mixed
$index
$type
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
public deleteTemplate ( $name ) : mixed
$name
Результат mixed

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

gets a document from the index
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html
public exists ( $index, $type, $id ) : mixed
$index
$type
$id
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html
public flushIndex ( $index = '_all' ) : mixed
$index
Результат mixed

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

gets a document from the index
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html
public get ( $index, $type, $id, array $options = [] ) : mixed
$index
$type
$id
$options array
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-status.html
public getIndexStatus ( $index = '_all' ) : mixed
$index
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html
public getMapping ( string $index = '_all', string $type = null ) : mixed
$index string
$type string
Результат mixed

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

gets a documents _source from the index (>=v0.90.1)
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html#_source
public getSource ( $index, $type, $id ) : mixed
$index
$type
$id
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
public getTemplate ( $name ) : mixed
$name
Результат mixed

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

checks whether an index exists
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html
public indexExists ( $index ) : mixed
$index
Результат mixed

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

Inserts a document into an index
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html
public insert ( string $index, string $type, string | array $data, null $id = null, array $options = [] ) : mixed
$index string
$type string
$data string | array json string or array of data to store
$id null the documents id. If not specified Id will be automatically chosen
$options array
Результат mixed

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

TODO allow specifying type and index + fields
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html
public mget ( $index, $type, $ids, array $options = [] ) : mixed
$index
$type
$ids
$options array
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html
public openIndex ( $index ) : mixed
$index
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html
public refreshIndex ( $index ) : mixed
$index
Результат mixed

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

См. также: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
С версии: 2.0.4
public scroll ( array $options = [] ) : mixed
$options array
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html
public setMapping ( string $index, string $type, string | array $mapping, array $options = [] ) : mixed
$index string
$type string
$mapping string | array
$options array
Результат mixed

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

Sends a request to the _suggest API and returns the result
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html
public suggest ( string | array $suggester, array $options = [] ) : mixed
$suggester string | array the suggester body
$options array
Результат mixed

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

См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html
public typeExists ( $index, $type ) : mixed
$index
$type
Результат mixed

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

updates a document
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html
public update ( $index, $type, $id, $data, array $options = [] ) : mixed
$index
$type
$id
$options array
Результат mixed

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

For example if content analyzer hasn’t been defined on "myindex" yet you can use the following commands to add it: ~~~ $setting = [ 'analysis' => [ 'analyzer' => [ 'ngram_analyzer_with_filter' => [ 'tokenizer' => 'ngram_tokenizer', 'filter' => 'lowercase, snowball' ], ], 'tokenizer' => [ 'ngram_tokenizer' => [ 'type' => 'nGram', 'min_gram' => 3, 'max_gram' => 10, 'token_chars' => ['letter', 'digit', 'whitespace', 'punctuation', 'symbol'] ], ], ] ]; $elasticQuery->createCommand()->updateAnalyzers('myindex', $setting); ~~~
См. также: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html#update-settings-analysis
С версии: 2.0.4
public updateAnalyzers ( string $index, string | array $setting, array $options = [] ) : mixed
$index string
$setting string | array
$options array URL options
Результат mixed

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

Note that update analyzers required to [[close()]] the index first and [[open()]] it after the changes are made, use Command::updateAnalyzers for it.
См. также: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-update-settings.html
С версии: 2.0.4
public updateSettings ( string $index, string | array $setting, array $options = [] ) : mixed
$index string
$setting string | array
$options array URL options
Результат mixed

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

$db публичное свойство

public Connection,yii\elasticsearch $db
Результат Connection

$index публичное свойство

the indexes to execute the query on. Defaults to null meaning all indexes
См. также: http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-multi-index-type
public $index

$options публичное свойство

options to be appended to the query URL, such as "search_type" for search or "timeout" for delete
public $options

$queryParts публичное свойство

list of arrays or json strings that become parts of a query
public $queryParts

$type публичное свойство

the types to execute the query on. Defaults to null meaning all types
public $type