df0/elasticraft

Craft 3 的 Elasticsearch 插件

安装: 589

依赖: 0

建议者: 0

安全: 0

星标: 12

关注者: 4

分支: 1

开放问题: 2

类型:craft-plugin

0.4.6 2018-03-08 21:56 UTC

This package is not auto-updated.

Last update: 2024-09-29 01:53:18 UTC


README

Craft 3 的 Elasticsearch 插件

安装

要安装 Elasticraft,请按照以下步骤操作

  1. 下载并解压缩文件,将 elasticraft 目录放入您的 craft/plugins 目录中
  2. -OR- 直接在您的 craft/plugins 文件夹中执行 git clone https://github.com/phoob/elasticraft.git。然后您可以使用 git pull 更新它
  3. -OR- 使用 Composer 通过 composer require phoob/elasticraft 安装
  4. 在 Craft 控制面板的设置 > 插件下安装插件
  5. 插件文件夹应命名为 elasticraft 以便 Craft 能够识别它。GitHub 最近开始将 -master(分支名称)附加到 zip 文件下载的文件夹名称中。

Elasticraft 支持 Craft 3.x。

Elasticraft 概述

提供基本功能,将条目和其他 Craft 元素索引到 Elasticsearch 服务器。

该插件使用 Elasticesearch PHP 客户端

配置 Elasticraft

src/config.php 复制到 craft/config/elasticraft.php,并配置要索引到 Elasticsearch 的元素的 hosts 和 pagetransformers。

pagetransformers 应继承 League\Fractal\TransformerAbstract – 请参阅 ./transformers/ 中的示例。

如果需要,请将服务器详细信息放入您的 .env 文件中。

ELASTIC_HOSTS=localhost:9200
ELASTIC_INDEX_NAME=craftdev

使用 Elasticraft

Elasticraft 在您保存或移动元素时索引元素(及其后代和祖先)。当元素在 Craft 中被删除时,它还会从 Elasticsearch 中删除该元素。

Elasticraft 路线图

  • 使其更加稳定并进行测试。它尚未在生产环境中使用。
  • 请注意,当前不使用设置页面和小部件。所有设置都在配置文件中配置。

Peter Holme Obrestad 提供