Spec-Zone.ru › Yii 2.0

Класс yii\elasticsearch\Command

Все классы | Свойства | Методы
Наследование yii\elasticsearch\Command » yii\base\Component » yii\base\Object
Реализует yii\base\Configurable
Доступно с версии 2.0
Исходный код https://github.com/yiisoft/yii2-elasticsearch/blob/master/Command.php

Класс Command реализует API для доступа к REST API elasticsearch.

Подробную информацию о командах см. в руководстве elasticsearch.

Публичные свойства

Свойство Тип Описание Определено в
$behaviors yii\base\Behavior[] Список прикреплённых к этому компоненту поведений yii\base\Component
$db yii\elasticsearch\Connection yii\elasticsearch\Command
$index string|array Индексы, на которых будет выполняться запрос. yii\elasticsearch\Command
$indexStatus mixed yii\elasticsearch\Command
$mapping mixed yii\elasticsearch\Command
$options array Параметры, добавляемые в URL запроса, например, "search_type" для поиска или "timeout" для удаления yii\elasticsearch\Command
$queryParts array Список массивов или json-строк, которые станут частями запроса yii\elasticsearch\Command
$type string|array Типы, на которых будет выполняться запрос. yii\elasticsearch\Command

Публичные методы

Метод Описание Определено в
__call() Вызывает именованный метод, который не является методом класса. yii\base\Component
__clone() Этот метод вызывается после создания объекта путём клонирования существующего. yii\base\Component
__construct() Конструктор. yii\base\Object
__get() Возвращает значение свойства компонента. yii\base\Component
__isset() Проверяет, установлено ли свойство, т.е. определено и не равно null. yii\base\Component
__set() Устанавливает значение свойства компонента. yii\base\Component
__unset() Устанавливает свойство компонента в null. yii\base\Component
attachBehavior() Прикрепляет поведение к данному компоненту. yii\base\Component
attachBehaviors() Прикрепляет список поведений к компоненту. yii\base\Component
behaviors() Возвращает список поведений, по которым должен действовать этот компонент. yii\base\Component
canGetProperty() Возвращает значение, указывающее, можно ли считать свойство. yii\base\Component
canSetProperty() Возвращает значение, указывающее, можно ли установить свойство. yii\base\Component
className() Возвращает полное квалифицированное имя этого класса. yii\base\Object
clearIndexCache() yii\elasticsearch\Command
clearScroll() yii\elasticsearch\Command
closeIndex() yii\elasticsearch\Command
createIndex() Создаёт индекс yii\elasticsearch\Command
createTemplate() yii\elasticsearch\Command
delete() Удаляет документ из индекса yii\elasticsearch\Command
deleteAllIndexes() Удаляет все индексы yii\elasticsearch\Command
deleteByQuery() Отправляет запрос на удаление по запросу yii\elasticsearch\Command
deleteIndex() Удаляет индекс yii\elasticsearch\Command
deleteMapping() yii\elasticsearch\Command
deleteTemplate() yii\elasticsearch\Command
detachBehavior() Открепляет поведение от компонента. yii\base\Component
detachBehaviors() Открепляет все поведения от компонента. yii\base\Component
ensureBehaviors() Убеждается, что поведения, объявленные в behaviors(), прикреплены к данному компоненту. yii\base\Component
exists() Получает документ из индекса yii\elasticsearch\Command
flushIndex() yii\elasticsearch\Command
get() Получает документ из индекса yii\elasticsearch\Command
getBehavior() Возвращает объект поведения с указанным именем. yii\base\Component
getBehaviors() Возвращает все прикрепленные к этому компоненту поведения. yii\base\Component
getIndexStatus() yii\elasticsearch\Command
getMapping() yii\elasticsearch\Command
getSource() Получает _source документа из индекса (>=v0.90.1) yii\elasticsearch\Command
getTemplate() yii\elasticsearch\Command
hasEventHandlers() Возвращает значение, указывающее, есть ли обработчик, прикреплённый к указанному событию. yii\base\Component
hasMethod() Возвращает значение, указывающее, определён ли метод. yii\base\Component
hasProperty() Возвращает значение, указывающее, определено ли свойство для этого компонента. yii\base\Component
indexExists() Проверяет существование индекса yii\elasticsearch\Command
init() Инициализирует объект. yii\base\Object
insert() Вставляет документ в индекс yii\elasticsearch\Command
mget() Получает несколько документов из индекса yii\elasticsearch\Command
off() Открепляет существующий обработчик событий от данного компонента. yii\base\Component
on() Прикрепляет обработчик событий к событию. yii\base\Component
openIndex() yii\elasticsearch\Command
refreshIndex() yii\elasticsearch\Command
scroll() yii\elasticsearch\Command
search() Отправляет запрос к API _search и возвращает результат yii\elasticsearch\Command
setMapping() yii\elasticsearch\Command
suggest() Отправляет запрос к API _suggest и возвращает результат yii\elasticsearch\Command
trigger() Вызывает событие. yii\base\Component
typeExists() yii\elasticsearch\Command
update() Обновляет документ yii\elasticsearch\Command
updateAnalyzers() Определяет новые анализаторы для индекса. yii\elasticsearch\Command
updateSettings() Изменяет конкретные настройки уровня индекса в реальном времени. yii\elasticsearch\Command

Свойства

$db общедоступное свойство

public yii\elasticsearch\Connection $db = null

$index общедоступное свойство

Индексы для выполнения запроса. По умолчанию равно null, что означает все индексы

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-multi-index-type.

public string|array $index = null

$indexStatus общедоступное только для чтения свойство

public mixed getIndexStatus ( $index = '_all' )

$mapping общедоступное только для чтения свойство

public mixed getMapping ( $index = '_all', $type = null )

$options общедоступное свойство

Параметры, которые будут добавлены к URL запроса, например, "search_type" для поиска или "timeout" для удаления

public array $options = []

$queryParts общедоступное свойство

Список массивов или json строк, которые становятся частями запроса

public array $queryParts = null

$type общедоступное свойство

Типы для выполнения запроса. По умолчанию равно null, что означает все типы

public string|array $type = null

Подробности методов

clearIndexCache() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html.

public mixed clearIndexCache ( $index )
$index

clearScroll() public method (доступно начиная с версии 2.0.4)

См. также https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html.

public mixed clearScroll ( $options = [] )
$options массив

closeIndex() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html.

public mixed closeIndex ( $index )
$index

createIndex() public method

Создаёт индекс

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html.

public mixed createIndex ( $index, $configuration = null )
$index
$configuration массив

createTemplate() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html.

public mixed createTemplate ( $name, $pattern, $settings, $mappings, $order = 0 )
$name
$pattern
$settings
$mappings
$order целое число

delete() public method

Удаляет документ из индекса

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html.

public mixed delete ( $index, $type, $id, $options = [] )
$index
$type
$id
$options массив

deleteAllIndexes() public method

Удаляет все индексы

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html.

public mixed deleteAllIndexes ( )

deleteByQuery() public method

Отправляет запрос на удаление по запросу

public mixed deleteByQuery ( $options = [] )
$options массив

deleteIndex() public method

Удаляет индекс

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html.

public mixed deleteIndex ( $index )
$index

deleteMapping() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html.

public mixed deleteMapping ( $index, $type )
$index
$type

deleteTemplate() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html.

public mixed deleteTemplate ( $name )
$name

exists() public method

Получает документ из индекса

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html.

public mixed exists ( $index, $type, $id )
$index
$type
$id

flushIndex() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html.

public mixed flushIndex ( $index = '_all' )
$index

get() public method

Получает документ из индекса

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html.

public mixed get ( $index, $type, $id, $options = [] )
$index
$type
$id
$options массив

getIndexStatus() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-status.html.

public mixed getIndexStatus ( $index = '_all' )
$index

getMapping() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html.

public mixed getMapping ( $index = '_all', $type = null )
$index строка
$type строка

getSource() public method

Получает _source документа из индекса (>=v0.90.1)

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html#_source.

public mixed getSource ( $index, $type, $id )
$index
$type
$id

getTemplate() public method

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html.

public mixed getTemplate ( $name )
$name

indexExists() public method

Проверяет существование индекса

См. также http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html.

public mixed indexExists ( $index )
$index

insert() public method

Вставляет документ в индекс

См. также http://www.elastic.co/guide/ru/elasticsearch/reference/current/docs-index_.html.

public mixed insert ( $index, $type, $data, $id = null, $options = [] )
$index string
$type string
$data string|array

Строка JSON или массив данных для хранения

$id null

Идентификатор документа. Если не указан, идентификатор будет выбран автоматически

$options array

mget() public method

Получение нескольких документов из индекса

TODO разрешить указание типа и индекса + полей

См. также http://www.elastic.co/guide/ru/elasticsearch/reference/current/docs-multi-get.html.

public mixed mget ( $index, $type, $ids, $options = [] )
$index
$type
$ids
$options array

openIndex() public method

См. также http://www.elastic.co/guide/ru/elasticsearch/reference/current/indices-open-close.html.

public mixed openIndex ( $index )
$index

refreshIndex() public method

См. также http://www.elastic.co/guide/ru/elasticsearch/reference/current/indices-refresh.html.

public mixed refreshIndex ( $index )
$index

scroll() public method (доступно начиная с версии 2.0.4)

См. также https://www.elastic.co/guide/ru/elasticsearch/reference/current/search-request-scroll.html.

public mixed scroll ( $options = [] )
$options array

search() public method

Отправляет запрос к API _search и возвращает результат

public mixed search ( $options = [] )
$options array

setMapping() public method

См. также http://www.elastic.co/guide/ru/elasticsearch/reference/current/indices-put-mapping.html.

public mixed setMapping ( $index, $type, $mapping, $options = [] )
$index string
$type string
$mapping string|array
$options array

suggest() public method

Отправляет запрос к API _suggest и возвращает результат

См. также http://www.elastic.co/guide/ru/elasticsearch/reference/current/search-suggesters.html.

public mixed suggest ( $suggester, $options = [] )
$suggester string|array

Тело суггестера

$options array

typeExists() public method

См. также http://www.elastic.co/guide/ru/elasticsearch/reference/current/indices-types-exists.html.

public mixed typeExists ( $index, $type )
$index
$type

update() public method

Обновляет документ

См. также http://www.elastic.co/guide/ru/elasticsearch/reference/current/docs-update.html.

public mixed update ( $index, $type, $id, $data, $options = [] )
$index
$type
$id
$data
$options array

updateAnalyzers() public method (доступно начиная с версии 2.0.4)

Определяет новые анализаторы для индекса.

Например, если анализатор контента ещё не определен для "myindex", можно использовать следующие команды для его добавления:

 $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/ru/elasticsearch/reference/current/indices-update-settings.html#update-settings-analysis.

public mixed updateAnalyzers ( $index, $setting, $options = [] )
$index string
$setting string|array
$options array

Параметры URL

updateSettings() public method (доступно начиная с версии 2.0.4)

Изменение определенных настроек уровня индекса в режиме реального времени.

Обратите внимание, что для обновления анализаторов необходимо сначала закрыть индекс \yii\elasticsearch\close(), а затем открыть \yii\elasticsearch\open() после внесения изменений. Используйте updateAnalyzers() для этой цели.

См. также http://www.elasticsearch.org/guide/ru/elasticsearch/reference/current/indices-update-settings.html.

public mixed updateSettings ( $index, $setting, $options = [] )
$index string
$setting string|array
$options array

Параметры URL

© 2008–2017 by Yii Software LLC
Licensed under the three clause BSD license.
http://www.yiiframework.com/doc-2.0/yii-elasticsearch-command.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API