承接 kaystrobach/visualsearch 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kaystrobach/visualsearch

Composer 安装命令:

composer require kaystrobach/visualsearch

包简介

package to handle advanced facetted searches

README 文档

README

StyleCI Codacy Badge

This package provides a powerful search component for Flow ecosystem. Any search repository can be made searchable by extending SearchableRepository and providing an appropriate configuration. The front-end component is provided as a Fluid partial.

Demo

Installation

composer require kaystrobach/visualsearch:^3.0.0

Usage

To make a repository searchable, extend SearchableRepository or implement the SearchableRepositoryInterface. Note that the defaultSearchName property should set to the name of the corresponding search configuration.

<?php

namespace Poke\Search\Domain\Repository;

use Neos\Flow\Annotations as Flow;
use Neos\Flow\Persistence\Repository;

use KayStrobach\VisualSearch\Domain\Repository\SearchableRepository;

/**
 * @Flow\Scope("singleton")
 */
class PokemonRepository extends SearchableRepository
{
    /**
     * @var string
     */
    protected $defaultSearchName = 'pokemon';

    public function findByName(string $name)
    {
        ...
    }
}

The repository can now be queried using the findByDefaultQuery method, e.g., from inside a controller action.

public function indexAction() {
    $this->view->assign('pokemon', $this->pokemonRepository->findByDefaultQuery());
}

To actually display the search component, include the search partial in your template.

<f:render partial="Visualsearch/Search" arguments="{searchName:'pokemon', pokemon:pokemon}" contentAs="value">
    ...
</f:render>

Listening to Events

You can use the visual-search-listener component to react to search events.

<visual-search-listener event="VisualSearchRequestUpdateChanged">
    <template>
        A change has happened, so the search results are not accurate anymore. Hit enter to trigger an update.
    </template>
</visual-search-listener>

External Sorting

You can use the visual-search-sort component to trigger sorting from outside the main search component.

<visual-search-sort asc="1" desc="2" selector="#my-search">
    <span slot="neutral"></span>
    <span slot="asc"></span>
    <span slot="desc"></span>
</visual-search-sort>

The component supports the following attributes:

  • asc: The value to set for ascending sort.
  • desc: (Optional) The value to set for descending sort.
  • selector: (Optional) A CSS selector to find the visual-search component (defaults to visual-search).
  • template: (Optional) ID of a <template> tag to use for rendering. If used, the wrapper div will have a class state-neutral, state-asc, or state-desc which you can use for styling.

Configuration

Search configurations are defined in the Configuration/VisualSearch.yaml file. Please see the demo package for an example configuration.

Theming

The search component can be styled using the following CSS properties:

Custom Property Default
--visual-search-background-color white
--visual-search-color black
--visual-search-background-color-focus lightgray
--visual-search-color-focus black
--visual-search-facet-background-color lightgray
--visual-search-facet-color black

Development

Install front-end dependencies via npm.

cd Resources/Private/App
npm install

After making changes to the front-end code, run the build script to bundle the assets.

npm run build

Linters are available for both JavaScript and CSS templates.

npm run lint:js
npm run lint:css

License

This project is licensed under the MIT License.

kaystrobach/visualsearch 适用场景与选型建议

kaystrobach/visualsearch 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.57k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2015 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-17