gemini/elastic-bool-query 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

gemini/elastic-bool-query

最新稳定版本:v0.4.2

Composer 安装命令:

composer require gemini/elastic-bool-query

包简介

关键字:

README 文档

README

composer require gemini/elastic-bool-query

使用

查询操作详见以下单元测试

https://github.com/Gemini-D/elastic-bool-query/blob/main/tests/Cases/BuilderTest.php

修改索引详见以下单元测试

https://github.com/Gemini-D/elastic-bool-query/blob/main/tests/Cases/IndicesTest.php

命令

  • 基于索引生成模型

-I 索引名 -M 模型全名

 php bin/hyperf.php gen:elastic model -I foo -M App\\Query\\Foo
  • 基于模型生成索引

假设模型为

<?php

declare(strict_types=1);

namespace App\Query;

use Fan\ElasticBoolQuery\Document;

class Foo extends Document
{
    public function getIndex(): string
    {
        return 'foo';
    }

    public function getMapping(): array
    {
        return [
            'id' => ['type' => 'long'],
            'name' => ['type' => 'keyword'],
            'summary' => ['type' => 'text'],
        ];
    }
}

-M 模型全名

php bin/hyperf.php gen:elastic index -M App\\Query\\Foo

Hyperf

发布配置

php bin/hyperf.php vendor:publish gemini/elastic-bool-query

创建模型

<?php

declare(strict_types=1);

use Fan\ElasticBoolQuery\Config;
use Fan\ElasticBoolQuery\Document;

class Foo extends Document
{
    public function getIndex(): string
    {
        return 'foo';
    }
}

使用

接下来就可以根据单测中的示例进行使用了,

写在最后

文档暂时没时间写,大家就看单测凑合凑合吧。

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-26