О нас
Разработчикам
Заметки
Переводчик
Транслитератор
Сравнить текст
Генератор пароля
Ip и информация
Декодировать JSON
Локация
О нас
Разработчикам
Заметки
Переводчик
Транслитератор
Сравнить текст
Генератор пароля
Ip и информация
Декодировать JSON
Локация
Elastic
us.content
https://elastica.io // Удалить эластик $Builder = \App\Facades\ElaIndex::products(); $Builder->getIndex()->delete(); // Создание индексов $Builder = \App\Facades\ElaIndex::products(); $Builder->createIndex(); // Посмотреть какие данные поподут в elastic modx $res = []; if ($object = $modx->getObject('msProduct', 777)) { $res[] = $object->toArrayElastic(); } // Получить 10 товаров $Products = \App\Facades\ElaIndex::products(); $index = $Products->getIndex()->search(); // Получить агрегации $fields = \Ela\Facades\Map::fieldsAggregation(); $client = new \Elastica\Client([ 'host' => 'localhost', 'port' => 32842, ]); $indexName = 'index_name'; $index = $client->getIndex($indexName); $mappings = $index->getMapping()['properties'] ?? null; $count = $index->count(); $search = $index->search(); $results = $search->getResults(); $res = []; foreach ($results as $result) { $res[] = $result->getData(); } // Создать и сохранить Mapping $properties = [ 'subgroup' => ['type' => 'keyword', 'ignore_above' => '256'], ]; $mapping = new \Elastica\Mapping($properties); $mapping->send($index);
Список