定制 glue-agency/craft-elastic-app-search 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

glue-agency/craft-elastic-app-search

最新稳定版本:5.0.1

Composer 安装命令:

composer require glue-agency/craft-elastic-app-search

包简介

Index Craft Entries to Elastic App Search

README 文档

README

Index Craft Entries to Elastic App Search

Requirements

This plugin requires Craft CMS 4.0.0 or later, and PHP 8.0.2 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Elastic App Search”. Then press “Install”.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require glue-agency/craft-elastic-app-search

# tell Craft to install the plugin
./craft plugin/install elastic-app-search

Usage

Backend

WIP

Frontend

Install the elasticsearch @elastic/app-search-javascript package.

The ElasticAppSearch Plugin config elastic-app-search.php has a setting exposeJsVars. When this is set to true, you are able to access the searchKey endpointBase and engineName that are needed to setup the Elastic Client.

Setup the Client

ElasticAppSearch.createClient({
    searchKey: window.elasticAppSearch.searchKey,
    endpointBase: window.elasticAppSearch.endpointBase,
    engineName: window.elasticAppSearch.engineName
});

Configuration

If you create a elastic-app-search.php file in the config folder you can overwrite the following plugin settings. The config file supports multi env setup.

<?php

return [
    /**
     * Connection settings
     */
    'endpoint'  => 'https://your-endpoint.found.io',
    'port'      => '9200',

    /** 
     * Authentication
     * 
     * Supported auth keys: "basic", "apiKey", "token"
     * 
     * Each auth key requires different settings:
     * basic: "username", "password"
     * apiKey: "apiKey"
     * token: "token"
     */
    'auth'      => 'apiKey',
    'apiKey'    => 'private-xxxxxxxxxxxxxxxxxxxx',

    /** 
     * Search
     */
    'searchKey' => 'search-xxxxxxxxxxxxxxxxxxxx',

    /** 
     * Sites
     * 
     * Manage Site indexing and linked indexes. Always requires
     * the "enabled" and "index" key for each indexable site. 
     * Missing sites will not be indexed.
     */
    'sites'     => [
        'site_nl' => [
            'enabled' => true,
            'index'   => 'site_index_nl',
        ],
        'site_en' => [
            'enabled' => true,
            'index'   => 'site_index_en',
        ],
    ],
];

统计信息

  • 总下载量: 144
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2023-08-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固