PHP 클래스 yii\elasticsearch\Command

Check the elasticsearch guide for details on these commands.
부터: 2.0
저자: Carsten Brandt ([email protected])
상속: extends yii\base\Component
파일 보기 프로젝트 열기: yiisoft/yii2-elasticsearch 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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