trinityrank/search 问题修复 & 功能扩展

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

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

trinityrank/search

Composer 安装命令:

composer require trinityrank/search

包简介

Search for your website

README 文档

README

Latest Version on Packagist Total Downloads

This package manage all data for search:

  • import
  • update
  • delete)
  • retrive data on frontend

We support multilanguage and shortcode ONLY if you are using our packages:

Installation

- Backend

Step 1: Install package

To get started with Laravel Search, use Composer command to add the package to your composer.json project's dependencies:

    composer require trinityrank/search

Step 2: Namespaces

  • In every tenant config add theese namespaces to include posts/pages/categories in your search
    ...
    // Include for search (articles, pages, categories...)
    'search' => [
        'App\\\Categories\\\Types\\\BlogCategory',
        'App\\\Categories\\\Types\\\NewsCategory',
        'App\\\Categories\\\Types\\\MoneyPageCategory',
        'App\\\Categories\\\Types\\\ReviewPageCategory',
        'App\\\Categories\\\Types\\\DealPageCategory',
        'App\\\Articles\\\Types\\\Blog',
        'App\\\Articles\\\Types\\\News',
        'App\\\Pages\\\Types\\\MoneyPage',
        'App\\\Pages\\\Types\\\ReviewPage',
        'App\\\Pages\\\Types\\\DealPage',
    ],
    ...

Step 3: Add .env params

  • Put your host and secret key into this variables
    SCOUT_QUEUE=false
    SCOUT_DRIVER=meilisearch
    MEILISEARCH_HOST=http://127.0.0.1:7700/
    MEILISEARCH_KEY=null

Step 4: Update config

  • Add this in config/scout.php at the end (if already exist ignore this step)
    ...
    'meilisearch' => [
        'host' => env('MEILISEARCH_HOST', 'http://localhost:7700'),
        'key' => env('MEILISEARCH_KEY', null),
    ],
    ...

Step 5: Database

  • You need to publish migration file from package
    php artisan vendor:publish --provider="Trinityrank\Search\SearchServiceProvider" --tag="search-migration"

And then you need to run migration for all tenants

    php artisan tenant:artisan "migrate"

Or only for one speciffic tenant

    php artisan tenant:artisan "migrate" --tenant=[--TENANT-ID--]

Step 7: Import search data

  • First delete all existing data and old indexes and then do fresh import data and update filters
    // delete
    php artisan search:delete
    php artisan search:delete-index

    // import
    php artisan search:import

    // update
    php artisan search:update-filters

- Frontend

Step 1: Install package

Install this two packages - trinityrank/search-multitenancy: latest version - meilisearch/meilisearch-php: ^0.24.1 or latest

    composer require meilisearch/meilisearch-php
    composer require trinityrank/search-multitenancy

Step 2: Add .env params

Put your host and secret key into this variables

    MEILISEARCH_HOST=http://127.0.0.1:7700/
    MEILISEARCH_KEY=null

Step 3: Publishing

  • You need to publish files from package (config and js file)
    php artisan vendor:publish --provider="Trinityrank\Search\SearchServiceProvider" --tag="search-config"

Step 4: JS

  • Include compiled JS file in your js mix
    ...
    .copy(
        'vendor/trinityrank/search/src/public/js/search.js',
        'public/js'
    )
    ...
  • Than xecute
    npm run dev
  • In your Blade file add this directive to include javascript

    • If you are adding into component add yhis part of code:
        @once
            @push('your-stack-name')
                @searchJs
            @endpush
        @endonce
    • If you are adding into layout you can add like this:
        @searchJs

trinityrank/search 适用场景与选型建议

trinityrank/search 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 86 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 12 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「search」 「nova」 「laravel」 「trinityrank」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 trinityrank/search 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 trinityrank/search 我们能提供哪些服务?
定制开发 / 二次开发

基于 trinityrank/search 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-19